Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
bool HeroBase::HaveSpellPoints(const Spell & spell) const
{
    return magic_point >= spell.SpellPoint(this);
}