コード例 #1
0
ファイル: Vampirism.php プロジェクト: gregwar/php
 /**
  * Frappe l'adversaire
  */
 public function attack(BaseCreature $runner, BaseCreature $target)
 {
     $life = 15 + mt_rand(0, 10);
     $target->hit($life);
     $runner->heal($life / 2.0);
 }
コード例 #2
0
ファイル: Elf.php プロジェクト: gregwar/php
 public function __construct($nickname)
 {
     parent::__construct($nickname);
     $this->attacks[] = new Hit();
     $this->attacks[] = new Arrow();
 }
コード例 #3
0
ファイル: Heal.php プロジェクト: gregwar/php
 /**
  * Frappe l'adversaire
  */
 public function attack(BaseCreature $runner, BaseCreature $target)
 {
     $runner->heal(25 + mt_rand(0, 10));
 }
コード例 #4
0
ファイル: Struggle.php プロジェクト: gregwar/php
 /**
  * Frappe l'adversaire, le lanceur se fait cependant aussi mal
  */
 public function attack(BaseCreature $runner, BaseCreature $target)
 {
     $target->hit(5 + mt_rand(0, 5));
     $runner->hit(1 + mt_rand(0, 3));
 }
コード例 #5
0
ファイル: Arrow.php プロジェクト: gregwar/php
 /**
  * Frappe l'adversaire
  */
 public function attack(BaseCreature $runner, BaseCreature $target)
 {
     $target->hit(20 + mt_rand(0, 10));
 }
コード例 #6
0
ファイル: Wizard.php プロジェクト: gregwar/php
 public function __construct($nickname)
 {
     parent::__construct($nickname);
     $this->attacks[] = new Tackle();
     $this->attacks[] = new Heal();
 }