void HeroBase::SpellCasted(const Spell & spell) { // resource cost Kingdom & kingdom = world.GetKingdom(GetColor()); const payment_t & cost = spell.GetCost(); if(cost.GetValidItemsCount()) kingdom.OddFundsResource(cost); // spell point cost magic_point -= (spell.SpellPoint(this) < magic_point ? spell.SpellPoint(this) : magic_point); // move point cost if(spell.MovePoint()) move_point -= (spell.MovePoint() < move_point ? spell.MovePoint() : move_point); }
bool HeroBase::HaveSpellPoints(const Spell & spell) const { return magic_point >= spell.SpellPoint(this); }