/** * hit method * @param Humanoid $fighter * @return string * */ public function hit(Humanoid $fighter) { $this->setScore($this->getScore() + 10); $currLive = $fighter->getLive(); $currLive -= 5; if ($currLive < 0) { $currLive = 0; } $fighter->setLive($currLive); return $this->getName() . " " . $this->getHitType() . " " . $fighter->getName(); }
/** * __construct method * @param string $name * */ public function __construct($name) { parent::__construct($name); $this->setNoise('Barev'); $this->setHitType('Harvacec'); }
/** * __construct method * @param string $name * */ public function __construct($name) { parent::__construct($name); $this->setNoise('meow'); $this->setHitType('scratch'); }
/** * __construct method * @param string $name * */ public function __construct($name) { parent::__construct($name); $this->setNoise('haf'); $this->setHitType('bit'); }
/** * __construct method * @param string $name * */ public function __construct($name) { parent::__construct($name); $this->setNoise('i he he'); }