1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Improvement for multiple-hex effects.

TODO: Attacker must know exact attacked tile, not only the stack.
This commit is contained in:
DjWarmonger
2011-07-03 05:55:57 +00:00
parent 4592ddb74e
commit 57a36e77f3
4 changed files with 38 additions and 4 deletions

View File

@@ -551,6 +551,7 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt
BattleStackAttacked bss = *bsa; // copy some parameters, such as attacker
std::set<CStack*> attackedCreatures = gs->curB->getAttackedCreatures(VLC->spellh->spells[bonus->subtype], bonus->val, att->owner, def->position);
//TODO: get exact attacked hex for defender
BOOST_FOREACH(CStack * stack, attackedCreatures)
{
@@ -3492,9 +3493,11 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, int destinatio
continue;
BattleStackAttacked bsa;
//TODO: display effect only upon primary target of area spell
bsa.flags |= BattleStackAttacked::EFFECT;
bsa.effect = spell->mainEffectAnim;
if (destination > -1 && (*it)->coversPos(destination)) //display effect only upon primary target of area spell
{
bsa.flags |= BattleStackAttacked::EFFECT;
bsa.effect = spell->mainEffectAnim;
}
bsa.damageAmount = gs->curB->calculateSpellDmg(spell, caster, *it, spellLvl, usedSpellPower);
bsa.stackAttacked = (*it)->ID;
bsa.attackerID = -1;