From 4676817c3b8ce54a062fbdd537ecb6f47c289086 Mon Sep 17 00:00:00 2001 From: kdmcser Date: Sat, 3 Aug 2024 00:47:23 +0800 Subject: [PATCH] not hardcore armageddon --- server/battles/BattleFlowProcessor.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/battles/BattleFlowProcessor.cpp b/server/battles/BattleFlowProcessor.cpp index 4344839da..bdd60b8bd 100644 --- a/server/battles/BattleFlowProcessor.cpp +++ b/server/battles/BattleFlowProcessor.cpp @@ -23,6 +23,7 @@ #include "../../lib/mapObjects/CGTownInstance.h" #include "../../lib/networkPacks/PacksForClientBattle.h" #include "../../lib/spells/BonusCaster.h" +#include "../../lib/spells/CSpellHandler.h" #include "../../lib/spells/ISpellMechanics.h" #include "../../lib/spells/ObstacleCasterProxy.h" @@ -128,7 +129,7 @@ void BattleFlowProcessor::tryPlaceMoats(const CBattleInfoCallback & battle) void BattleFlowProcessor::onBattleStarted(const CBattleInfoCallback & battle) { tryPlaceMoats(battle); - + gameHandler->turnTimerHandler->onBattleStart(battle.getBattle()->getBattleID()); if (battle.battleGetTacticDist() == 0) @@ -321,7 +322,7 @@ void BattleFlowProcessor::activateNextStack(const CBattleInfoCallback & battle) if(!removeGhosts.changedStacks.empty()) gameHandler->sendAndApply(&removeGhosts); - + gameHandler->turnTimerHandler->onBattleNextStack(battle.getBattle()->getBattleID(), *next); if (!tryMakeAutomaticAction(battle, next)) @@ -759,8 +760,11 @@ void BattleFlowProcessor::stackTurnTrigger(const CBattleInfoCallback & battle, c }); spells::BattleCast parameters(&battle, st, spells::Mode::ENCHANTER, spell); parameters.setSpellLevel(bonus->val); - //todo: not hardcode - if (spellID != SpellID::ARMAGEDDON) { + + auto &levelInfo = spell->getLevelInfo(bonus->val); + bool isDamageSpell = spell->isDamage() || spell->isOffensive(); + if (!isDamageSpell || levelInfo.smartTarget || levelInfo.range != "X") + { parameters.massive = true; parameters.smart = true; }