mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Rename DEAD_CLONE -> GHOST, as this will be possible for any stack
This commit is contained in:
parent
d2a5e64542
commit
5d5ad99436
@ -288,9 +288,9 @@ public:
|
|||||||
{
|
{
|
||||||
return vstd::contains(state,EBattleStackState::ALIVE);
|
return vstd::contains(state,EBattleStackState::ALIVE);
|
||||||
}
|
}
|
||||||
bool idDeadClone() const //determines if stack is alive
|
bool isGhost() const //determines if stack was removed
|
||||||
{
|
{
|
||||||
return vstd::contains(state,EBattleStackState::DEAD_CLONE);
|
return vstd::contains(state,EBattleStackState::GHOST);
|
||||||
}
|
}
|
||||||
bool isValidTarget(bool allowDead = false) const; //alive non-turret stacks (can be attacked or be object of magic effect)
|
bool isValidTarget(bool allowDead = false) const; //alive non-turret stacks (can be attacked or be object of magic effect)
|
||||||
};
|
};
|
||||||
|
@ -471,7 +471,7 @@ namespace EBattleStackState
|
|||||||
{
|
{
|
||||||
ALIVE = 180,
|
ALIVE = 180,
|
||||||
SUMMONED, CLONED,
|
SUMMONED, CLONED,
|
||||||
DEAD_CLONE,
|
GHOST, //stack was removed from battlefield
|
||||||
HAD_MORALE,
|
HAD_MORALE,
|
||||||
WAITING,
|
WAITING,
|
||||||
MOVED,
|
MOVED,
|
||||||
|
@ -1312,7 +1312,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
|
|||||||
{
|
{
|
||||||
//remove clone as well
|
//remove clone as well
|
||||||
CStack * clone = gs->curB->getStack(at->cloneID);
|
CStack * clone = gs->curB->getStack(at->cloneID);
|
||||||
clone->state.insert(EBattleStackState::DEAD_CLONE);
|
clone->state.insert(EBattleStackState::GHOST);
|
||||||
at->cloneID = -1;
|
at->cloneID = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1329,7 +1329,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
|
|||||||
if (cloneKilled())
|
if (cloneKilled())
|
||||||
{
|
{
|
||||||
//"hide" killed creatures instead so we keep info about it
|
//"hide" killed creatures instead so we keep info about it
|
||||||
at->state.insert(EBattleStackState::DEAD_CLONE);
|
at->state.insert(EBattleStackState::GHOST);
|
||||||
|
|
||||||
for(CStack * s : gs->curB->stacks)
|
for(CStack * s : gs->curB->stacks)
|
||||||
{
|
{
|
||||||
@ -1340,7 +1340,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
|
|||||||
|
|
||||||
//killed summoned creature should be removed like clone
|
//killed summoned creature should be removed like clone
|
||||||
if(killed() && vstd::contains(at->state, EBattleStackState::SUMMONED))
|
if(killed() && vstd::contains(at->state, EBattleStackState::SUMMONED))
|
||||||
at->state.insert(EBattleStackState::DEAD_CLONE);
|
at->state.insert(EBattleStackState::GHOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
|
DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
|
||||||
|
@ -5610,7 +5610,7 @@ void CGameHandler::runBattle()
|
|||||||
std::set <const CStack*> stacksToRemove;
|
std::set <const CStack*> stacksToRemove;
|
||||||
for (auto stack : curB.stacks)
|
for (auto stack : curB.stacks)
|
||||||
{
|
{
|
||||||
if (stack->idDeadClone())
|
if (stack->isGhost())
|
||||||
stacksToRemove.insert(stack);
|
stacksToRemove.insert(stack);
|
||||||
}
|
}
|
||||||
for (auto stack : stacksToRemove)
|
for (auto stack : stacksToRemove)
|
||||||
|
Loading…
Reference in New Issue
Block a user