mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-31 22:05:10 +02:00
castSpellThisTurn to bool var
This commit is contained in:
parent
0aaafc4c8a
commit
735af83294
@ -330,7 +330,7 @@ CUnitState::CUnitState():
|
|||||||
drainedMana(false),
|
drainedMana(false),
|
||||||
fear(false),
|
fear(false),
|
||||||
hadMorale(false),
|
hadMorale(false),
|
||||||
usedSpell(SpellID::NONE),
|
castSpellThisTurn(false),
|
||||||
ghost(false),
|
ghost(false),
|
||||||
ghostPending(false),
|
ghostPending(false),
|
||||||
movedThisRound(false),
|
movedThisRound(false),
|
||||||
@ -363,7 +363,7 @@ CUnitState & CUnitState::operator=(const CUnitState & other)
|
|||||||
drainedMana = other.drainedMana;
|
drainedMana = other.drainedMana;
|
||||||
fear = other.fear;
|
fear = other.fear;
|
||||||
hadMorale = other.hadMorale;
|
hadMorale = other.hadMorale;
|
||||||
usedSpell = other.usedSpell;
|
castSpellThisTurn = other.castSpellThisTurn;
|
||||||
ghost = other.ghost;
|
ghost = other.ghost;
|
||||||
ghostPending = other.ghostPending;
|
ghostPending = other.ghostPending;
|
||||||
movedThisRound = other.movedThisRound;
|
movedThisRound = other.movedThisRound;
|
||||||
@ -534,7 +534,7 @@ bool CUnitState::hasClone() const
|
|||||||
|
|
||||||
bool CUnitState::canCast() const
|
bool CUnitState::canCast() const
|
||||||
{
|
{
|
||||||
return casts.canUse(1) && usedSpell == SpellID::NONE;//do not check specific cast abilities here
|
return casts.canUse(1) && !castSpellThisTurn;//do not check specific cast abilities here
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CUnitState::isCaster() const
|
bool CUnitState::isCaster() const
|
||||||
@ -750,7 +750,7 @@ void CUnitState::serializeJson(JsonSerializeFormat & handler)
|
|||||||
handler.serializeBool("drainedMana", drainedMana);
|
handler.serializeBool("drainedMana", drainedMana);
|
||||||
handler.serializeBool("fear", fear);
|
handler.serializeBool("fear", fear);
|
||||||
handler.serializeBool("hadMorale", hadMorale);
|
handler.serializeBool("hadMorale", hadMorale);
|
||||||
handler.serializeInt("usedSpell", usedSpell);
|
handler.serializeBool("castSpellThisTurn", castSpellThisTurn);
|
||||||
handler.serializeBool("ghost", ghost);
|
handler.serializeBool("ghost", ghost);
|
||||||
handler.serializeBool("ghostPending", ghostPending);
|
handler.serializeBool("ghostPending", ghostPending);
|
||||||
handler.serializeBool("moved", movedThisRound);
|
handler.serializeBool("moved", movedThisRound);
|
||||||
@ -785,7 +785,7 @@ void CUnitState::reset()
|
|||||||
drainedMana = false;
|
drainedMana = false;
|
||||||
fear = false;
|
fear = false;
|
||||||
hadMorale = false;
|
hadMorale = false;
|
||||||
usedSpell = SpellID::NONE;
|
castSpellThisTurn = false;
|
||||||
ghost = false;
|
ghost = false;
|
||||||
ghostPending = false;
|
ghostPending = false;
|
||||||
movedThisRound = false;
|
movedThisRound = false;
|
||||||
@ -868,7 +868,7 @@ void CUnitState::afterNewRound()
|
|||||||
waitedThisTurn = false;
|
waitedThisTurn = false;
|
||||||
movedThisRound = false;
|
movedThisRound = false;
|
||||||
hadMorale = false;
|
hadMorale = false;
|
||||||
usedSpell = SpellID::NONE;
|
castSpellThisTurn = false;
|
||||||
fear = false;
|
fear = false;
|
||||||
drainedMana = false;
|
drainedMana = false;
|
||||||
counterAttacks.reset();
|
counterAttacks.reset();
|
||||||
|
@ -141,7 +141,7 @@ public:
|
|||||||
bool drainedMana;
|
bool drainedMana;
|
||||||
bool fear;
|
bool fear;
|
||||||
bool hadMorale;
|
bool hadMorale;
|
||||||
SpellID usedSpell;
|
bool castSpellThisTurn;
|
||||||
bool ghost;
|
bool ghost;
|
||||||
bool ghostPending;
|
bool ghostPending;
|
||||||
bool movedThisRound;
|
bool movedThisRound;
|
||||||
|
@ -2209,7 +2209,7 @@ void StartAction::applyGs(CGameState *gs)
|
|||||||
st->waiting = false;
|
st->waiting = false;
|
||||||
st->defendingAnim = false;
|
st->defendingAnim = false;
|
||||||
st->movedThisRound = true;
|
st->movedThisRound = true;
|
||||||
st->usedSpell = ba.actionType == EActionType::MONSTER_SPELL ? ba.spell : SpellID::NONE;
|
st->castSpellThisTurn = ba.actionType == EActionType::MONSTER_SPELL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ void BattleFlowProcessor::onActionMade(const CBattleInfoCallback & battle, const
|
|||||||
assert(activeStack != nullptr);
|
assert(activeStack != nullptr);
|
||||||
assert(actedStack != nullptr);
|
assert(actedStack != nullptr);
|
||||||
|
|
||||||
if(actedStack->usedSpell != SpellID::NONE && SpellID(actedStack->usedSpell).toSpell()->canCastWithoutSkip())
|
if(actedStack->castSpellThisTurn && SpellID(ba.spell).toSpell()->canCastWithoutSkip())
|
||||||
{
|
{
|
||||||
setActiveStack(battle, actedStack);
|
setActiveStack(battle, actedStack);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user