Compare commits
2 commits
43763a3dbc
...
8805738c50
Author | SHA1 | Date | |
---|---|---|---|
8805738c50 | |||
bb3b2916d1 |
1 changed files with 29 additions and 6 deletions
|
@ -3,6 +3,7 @@
|
|||
class Entity{
|
||||
private $name;
|
||||
private $armour_class;
|
||||
private $inisitive;
|
||||
private $fullhp;
|
||||
private $hp;
|
||||
private $str;
|
||||
|
@ -12,25 +13,34 @@ class Entity{
|
|||
private $wis;
|
||||
private $chr;
|
||||
private $align;
|
||||
|
||||
|
||||
public function setName(String $name){
|
||||
$this->name = $name;
|
||||
}
|
||||
public function getName(){
|
||||
return $this->name;
|
||||
}
|
||||
public function setInisitive(int $init){
|
||||
$this->inisitive = $init;
|
||||
}
|
||||
public function getInisitive(){
|
||||
return $this->init;
|
||||
}
|
||||
public function setAC(int $ac){
|
||||
$this->armour_class = $ac;
|
||||
}
|
||||
public function getAC(){
|
||||
return $this->armour_class;
|
||||
}
|
||||
|
||||
|
||||
public function getCurrentHP(){
|
||||
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;
|
||||
|
@ -84,9 +94,22 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Enemy extends Entity{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue