1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Add SYNERGY_TARGET and [wip]-SHOOTS_ALL_ADJACENT

This commit is contained in:
Dydzio
2017-09-04 23:32:24 +02:00
parent 1df939bf70
commit 4cab76900f
5 changed files with 233 additions and 209 deletions

View File

@@ -892,16 +892,14 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt
// only primary target
applyBattleEffects(bat, att, def, distance, false);
if (!bat.shot()) //multiple-hex attack - only in meele
{
std::set<const CStack*> attackedCreatures = gs->curB->getAttackedCreatures(att, targetHex); //creatures other than primary target
//multiple-hex normal attack
std::set<const CStack*> attackedCreatures = gs->curB->getAttackedCreatures(att, targetHex, bat.shot()); //creatures other than primary target
for (const CStack * stack : attackedCreatures)
for (const CStack * stack : attackedCreatures)
{
if (stack != def) //do not hit same stack twice
{
if (stack != def) //do not hit same stack twice
{
applyBattleEffects(bat, att, stack, distance, true);
}
applyBattleEffects(bat, att, stack, distance, true);
}
}
@@ -914,11 +912,11 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt
//TODO: should spell override creature`s projectile?
auto attackedCreatures = SpellID(bonus->subtype).toSpell()->getAffectedStacks(gs->curB, ECastingMode::SPELL_LIKE_ATTACK, att, bonus->val, targetHex);
auto affectedCreatures = SpellID(bonus->subtype).toSpell()->getAffectedStacks(gs->curB, ECastingMode::SPELL_LIKE_ATTACK, att, bonus->val, targetHex);
//TODO: get exact attacked hex for defender
for (const CStack * stack : attackedCreatures)
for (const CStack * stack : affectedCreatures)
{
if (stack != def) //do not hit same stack twice
{