mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
fix formatting
This commit is contained in:
@@ -342,9 +342,15 @@ void BattleFlowProcessor::activateNextStack(const CBattleInfoCallback & battle)
|
||||
|
||||
bool BattleFlowProcessor::tryMakeAutomaticAction(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
bool actionPerformed = tryActivateMoralePenalty(battle, next) || tryActivateBerserkPenalty(battle, next) || tryAutomaticActionOfWarMachines(battle, next);
|
||||
if(tryActivateMoralePenalty(battle, next))
|
||||
return true;
|
||||
|
||||
if(tryActivateBerserkPenalty(battle, next))
|
||||
return true;
|
||||
|
||||
if(tryAutomaticActionOfWarMachines(battle, next))
|
||||
return true;
|
||||
|
||||
if (!actionPerformed) {
|
||||
stackTurnTrigger(battle, next); //various effects
|
||||
|
||||
if(next->fear)
|
||||
@@ -352,8 +358,8 @@ bool BattleFlowProcessor::tryMakeAutomaticAction(const CBattleInfoCallback & bat
|
||||
makeStackDoNothing(battle, next); //end immediately if stack was affected by fear
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return actionPerformed;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryActivateMoralePenalty(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
@@ -377,7 +383,8 @@ bool BattleFlowProcessor::tryActivateMoralePenalty(const CBattleInfoCallback & b
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryActivateBerserkPenalty(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
bool BattleFlowProcessor::tryActivateBerserkPenalty(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
if (next->hasBonusOfType(BonusType::ATTACKS_NEAREST_CREATURE)) //while in berserk
|
||||
{
|
||||
logGlobal->trace("Handle Berserk effect");
|
||||
@@ -404,11 +411,22 @@ bool BattleFlowProcessor::tryActivateBerserkPenalty(const CBattleInfoCallback &
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryAutomaticActionOfWarMachines(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
return tryMakeAutomaticActionOfBallistaOrTowers(battle, next) || tryMakeAutomaticActionOfCatapult(battle, next) || tryMakeAutomaticActionOfFirstAidTent(battle, next);
|
||||
bool BattleFlowProcessor::tryAutomaticActionOfWarMachines(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
if (tryMakeAutomaticActionOfBallistaOrTowers(battle, next))
|
||||
return true;
|
||||
|
||||
if (tryMakeAutomaticActionOfCatapult(battle, next))
|
||||
return true;
|
||||
|
||||
if (tryMakeAutomaticActionOfFirstAidTent(battle, next))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfBallistaOrTowers(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfBallistaOrTowers(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
const CGHeroInstance * curOwner = battle.battleGetOwnerHero(next);
|
||||
const CreatureID stackCreatureId = next->unitType()->getId();
|
||||
|
||||
@@ -477,7 +495,8 @@ bool BattleFlowProcessor::tryMakeAutomaticActionOfBallistaOrTowers(const CBattle
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfCatapult(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfCatapult(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
const CGHeroInstance * curOwner = battle.battleGetOwnerHero(next);
|
||||
if (next->unitType()->getId() == CreatureID::CATAPULT)
|
||||
{
|
||||
@@ -503,7 +522,8 @@ bool BattleFlowProcessor::tryMakeAutomaticActionOfCatapult(const CBattleInfoCall
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfFirstAidTent(const CBattleInfoCallback & battle, const CStack * next) {
|
||||
bool BattleFlowProcessor::tryMakeAutomaticActionOfFirstAidTent(const CBattleInfoCallback & battle, const CStack * next)
|
||||
{
|
||||
const CGHeroInstance * curOwner = battle.battleGetOwnerHero(next);
|
||||
if (next->unitType()->getId() == CreatureID::FIRST_AID_TENT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user