コード例 #1
0
ファイル: Kouzelnik.php プロジェクト: bebbana/x-files
 /**
  * Provede útok na soupeře
  * @param Bojovnik $souper Soupeř bojovník
  */
 public function utoc($souper)
 {
     $uder = $this->utok + rand(1, 20);
     $uderMana = $this->utok + 30 + rand(1, 20);
     if ($this->mana == $this->maxMana) {
         parent::nastavZpravu("{$this->jmeno} použil kouzlo za {$uderMana} hp");
         $this->mana = 0;
     } else {
         if ($this->mana < $this->maxMana) {
             $this->mana = $this->mana + 10;
         } else {
             $this->mana = $this->maxMana;
         }
         parent::nastavZpravu("{$this->jmeno} útočí s úderem za {$uder} hp");
     }
     $souper->branSe($uder);
 }