1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Rename DEAD_CLONE -> GHOST, as this will be possible for any stack

This commit is contained in:
AlexVinS 2016-02-28 00:13:34 +03:00
parent d2a5e64542
commit 5d5ad99436
4 changed files with 10 additions and 10 deletions

View File

@ -110,9 +110,9 @@ struct DLL_LINKAGE BattleInfo : public CBonusSystemNode, public CBattleInfoCallb
CStack * getStackT(BattleHex tileID, bool onlyAlive = true);
CStack * getStack(int stackID, bool onlyAlive = true);
using CBattleInfoEssentials::battleGetArmyObject;
CArmedInstance * battleGetArmyObject(ui8 side) const;
CArmedInstance * battleGetArmyObject(ui8 side) const;
using CBattleInfoEssentials::battleGetFightingHero;
CGHeroInstance * battleGetFightingHero(ui8 side) const;
CGHeroInstance * battleGetFightingHero(ui8 side) const;
const CStack * getNextStack() const; //which stack will have turn after current one
//void getStackQueue(std::vector<const CStack *> &out, int howMany, int turn = 0, int lastMoved = -1) const; //returns stack in order of their movement action
@ -247,7 +247,7 @@ public:
int getEffectValue(const CSpell * spell) const override;
const PlayerColor getOwner() const override;
template <typename Handler> void serialize(Handler &h, const int version)
{
assert(isIndependentNode());
@ -288,9 +288,9 @@ public:
{
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)
};

View File

@ -471,7 +471,7 @@ namespace EBattleStackState
{
ALIVE = 180,
SUMMONED, CLONED,
DEAD_CLONE,
GHOST, //stack was removed from battlefield
HAD_MORALE,
WAITING,
MOVED,

View File

@ -1312,7 +1312,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
{
//remove clone as well
CStack * clone = gs->curB->getStack(at->cloneID);
clone->state.insert(EBattleStackState::DEAD_CLONE);
clone->state.insert(EBattleStackState::GHOST);
at->cloneID = -1;
}
}
@ -1329,7 +1329,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
if (cloneKilled())
{
//"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)
{
@ -1340,7 +1340,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
//killed summoned creature should be removed like clone
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 )

View File

@ -5610,7 +5610,7 @@ void CGameHandler::runBattle()
std::set <const CStack*> stacksToRemove;
for (auto stack : curB.stacks)
{
if (stack->idDeadClone())
if (stack->isGhost())
stacksToRemove.insert(stack);
}
for (auto stack : stacksToRemove)