Added construct
This commit is contained in:
parent
bb3b2916d1
commit
8805738c50
1 changed files with 22 additions and 6 deletions
|
@ -37,7 +37,10 @@ class Entity{
|
|||
return $this->hp;
|
||||
}
|
||||
public function getMaxHP(){
|
||||
return $this->hp;
|
||||
return $this->fullhp;
|
||||
}
|
||||
public function setMaxHP(int $hp){
|
||||
$this->fullhp = $hp;
|
||||
}
|
||||
public function restoreToFullHP(){
|
||||
$this->hp = $this->fullhp;
|
||||
|
@ -91,6 +94,19 @@ class Entity{
|
|||
public function getCharisma,(){
|
||||
return $this->chr;
|
||||
}
|
||||
public function __construct($name , $armour_class , $inisitive , $fullhp, $str , $dex , $con , $int , $wis , $chr) {
|
||||
$this->setName($name);
|
||||
$this->setAC($armour_class);
|
||||
$this->setInisitive($inisitive);
|
||||
$this->setMaxHP($fullhp);
|
||||
$this->restoreToFullHP();
|
||||
$this->setStrength($str);
|
||||
$this->setDexterity($dex);
|
||||
$this->setConstitution($con);
|
||||
$this->setInisitive($int);
|
||||
$this->setWisdom($wis);
|
||||
$this->setCharisma($chr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue