From 81180de8bee6edf3a6f608eb7a827cc99a70c5af Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sat, 2 Jul 2011 17:40:33 +0000 Subject: [PATCH] Handling of area attack animation & effect --- client/CPlayerInterface.cpp | 7 +++++-- server/CGameHandler.cpp | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index ad1dff348..7eac0a00f 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -835,11 +835,14 @@ void CPlayerInterface::battleAttack(const BattleAttack *ba) for(std::vector::const_iterator i = ba->bsa.begin(); i != ba->bsa.end(); i++) { const CStack * attacked = cb->battleGetStackByID(i->stackAttacked); - battleInt->stackAttacking(attacker, cb->battleGetPos(i->stackAttacked), attacked, true); + if (!i->isSecondary()) //display projectile only for primary target + { + battleInt->stackAttacking(attacker, cb->battleGetPos(i->stackAttacked), attacked, true); + } } } else - {//WARNING: does not support multiple attacked creatures + {//TODO: support multiple attacked creatures int shift = 0; if(ba->counter() && THex::mutualPosition(curAction->destinationTile, attacker->position) < 0) { diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 4cddae5db..8b46004d8 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -546,6 +546,9 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt const Bonus * bonus = att->getBonus(Selector::type(Bonus::SPELL_LIKE_ATTACK)); if (bonus) { + bsa->flags |= BattleStackAttacked::EFFECT; + bsa->effect = VLC->spellh->spells[bonus->subtype]->mainEffectAnim; //hopefully it does not interfere with any other effect? + BattleStackAttacked bss = *bsa; // copy some parameters, such as attacker std::set attackedCreatures = gs->curB->getAttackedCreatures(VLC->spellh->spells[bonus->subtype], bonus->val, att->owner, def->position); @@ -3489,6 +3492,7 @@ 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; bsa.damageAmount = gs->curB->calculateSpellDmg(spell, caster, *it, spellLvl, usedSpellPower);