Пример #1
0
 /**
  * Spend mana for a spell
  *
  * @param Spell $spell
  *
  * @return bool
  */
 public function spendMana($spell)
 {
     $this->mp -= $spell->getCost();
     if ($this->mp <= 0) {
         return false;
     }
     return true;
 }
Пример #2
0
 public function isSpellAvailable(Spell $spell)
 {
     if ($spell instanceof Effect && $spell->isActive()) {
         return false;
     }
     return $spell->getCost() <= $this->playerMana;
 }