1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
This commit is contained in:
DjWarmonger 2013-05-30 07:43:42 +00:00
parent 4cc28d5e91
commit 22e14d31cb

View File

@ -798,15 +798,15 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
//fire shield handling //fire shield handling
if (!bat.shot() && def->hasBonusOfType(Bonus::FIRE_SHIELD) && !att->hasBonusOfType (Bonus::FIRE_IMMUNITY) && !bsa.killed() ) if (!bat.shot() && def->hasBonusOfType(Bonus::FIRE_SHIELD) && !att->hasBonusOfType (Bonus::FIRE_IMMUNITY) && !bsa.killed() )
{ {
BattleStackAttacked bsa; BattleStackAttacked bsa2;
bsa.stackAttacked = att->ID; //invert bsa2.stackAttacked = att->ID; //invert
bsa.attackerID = def->ID; bsa2.attackerID = def->ID;
bsa.flags |= BattleStackAttacked::EFFECT; bsa2.flags |= BattleStackAttacked::EFFECT; //FIXME: play anmation upon efreet and not attacker
bsa.effect = 11; bsa2.effect = 11;
bsa.damageAmount = (bsa.damageAmount * def->valOfBonuses(Bonus::FIRE_SHIELD)) / 100; //TODO: scale with attack/defense bsa2.damageAmount = (bsa.damageAmount * def->valOfBonuses(Bonus::FIRE_SHIELD)) / 100; //TODO: scale with attack/defense
att->prepareAttacked(bsa); att->prepareAttacked(bsa2);
bat.bsa.push_back(bsa); bat.bsa.push_back(bsa2);
} }
} }
void CGameHandler::handleConnection(std::set<PlayerColor> players, CConnection &c) void CGameHandler::handleConnection(std::set<PlayerColor> players, CConnection &c)
@ -4503,12 +4503,12 @@ void CGameHandler::stackTurnTrigger(const CStack * st)
} }
} }
} }
if (!st->hasBonusOfType(Bonus::FEARLESS)) if (st->isLiving() && !st->hasBonusOfType(Bonus::FEARLESS))
{ {
bool fearsomeCreature = false; bool fearsomeCreature = false;
BOOST_FOREACH(CStack * stack, gs->curB->stacks) BOOST_FOREACH(CStack * stack, gs->curB->stacks)
{ {
if (stack->owner != st->owner && stack->hasBonusOfType(Bonus::FEAR)) if (stack->owner != st->owner && stack->alive() && stack->hasBonusOfType(Bonus::FEAR))
{ {
fearsomeCreature = true; fearsomeCreature = true;
break; break;