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:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user