Example #1
0
 public function lancersorts(Perso $adversaire, $nomSorts)
 {
     $hasSorts = false;
     foreach ($this->sorts as $key => $sorts) {
         if ($sorts->getName() == $nomSorts) {
             $hasSorts = true;
             $degat = $sorts->getDegats();
         }
     }
     if ($hasSorts) {
         $adversaire->minusHP($degat);
         return $this;
     } else {
         echo self::MESSAGE_ABSCENCE_DE_SORTS;
         return $this;
     }
 }
Example #2
0
 final function doDamage(Perso $other)
 {
     $rand = rand(5, 25) * $this->Multiplier;
     $other->setHP($other->getHP() - $rand);
     echo $this->Name . " Does <span class='red'>" . $rand . "</span> HP damage to " . $other->getName() . PHP_EOL . "<br>";
 }
Example #3
0
 public function frappe(Perso $adversaire)
 {
     $adversaire->minusHP(self::DEGATS);
 }
Example #4
0
 public function __construct(array $donnee)
 {
     parent::__construct($donnee);
 }