1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Support for Enchanter ability.

This commit is contained in:
DjWarmonger
2011-10-09 07:20:23 +00:00
parent d607d90a91
commit 5e40d3da72
8 changed files with 81 additions and 26 deletions

View File

@ -839,6 +839,11 @@ DLL_EXPORT void BattleStart::applyGs( CGameState *gs )
DLL_EXPORT void BattleNextRound::applyGs( CGameState *gs )
{
gs->curB->castSpells[0] = gs->curB->castSpells[1] = 0;
for (int i = 0; i < 2; ++i)
{
amax(--gs->curB->enchanterCounter[i], 0);
}
gs->curB->round = round;
BOOST_FOREACH(CStack *s, gs->curB->stacks)
@ -1296,6 +1301,16 @@ DLL_EXPORT void BattleSetStackProperty::applyGs(CGameState *gs)
amax(stack->casts, 0);
break;
}
case ENCHANTER_COUNTER:
{
int side = gs->curB->whatSide(stack->owner);
if (absolute)
gs->curB->enchanterCounter[side] = val;
else
gs->curB->enchanterCounter[side] += val;
amax(gs->curB->enchanterCounter[side], 0);
break;
}
}
}