Compare commits

...

3 commits

Author SHA1 Message Date
9a63dbbc45 Added classes to Player class 2019-01-03 17:09:14 +01:00
a720cbe1d2 Added Player Class 2019-01-03 17:06:32 +01:00
3e09de564c Added actions 2019-01-03 17:04:16 +01:00

View file

@ -111,5 +111,40 @@ class Entity{
}
class Enemy extends Entity{
private $actions = array();
public function getActions()
{
return $this->actions;
}
function addAction($name)
{
array_push($this->actions,$name);
}
public function resetActions()
{
$this->actions =array;
}
}
class Player extends Entity{
private $class;
public function getClass(){
return $this->class
}
public function __construct($name , $armour_class , $inisitive , $fullhp, $str , $dex , $con , $int , $wis , $chr,$class) {
$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);
$this->class = $class;
}
}