コード例 #1
0
ファイル: Fighting.php プロジェクト: varyan/namecpaseSystem
 /**
  * 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();
 }
コード例 #2
0
ファイル: Men.php プロジェクト: varyan/namecpaseSystem
 /**
  * __construct method
  * @param string $name
  * */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->setNoise('Barev');
     $this->setHitType('Harvacec');
 }
コード例 #3
0
ファイル: Cat.php プロジェクト: varyan/namecpaseSystem
 /**
  * __construct method
  * @param string $name
  * */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->setNoise('meow');
     $this->setHitType('scratch');
 }
コード例 #4
0
ファイル: Dog.php プロジェクト: varyan/namecpaseSystem
 /**
  * __construct method
  * @param string $name
  * */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->setNoise('haf');
     $this->setHitType('bit');
 }
コード例 #5
0
ファイル: Horse.php プロジェクト: varyan/namecpaseSystem
 /**
  * __construct method
  * @param string $name
  * */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->setNoise('i he he');
 }