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

* new spell (disrupting ray)

* a few code cleanups
This commit is contained in:
mateuszb
2009-04-21 17:32:43 +00:00
parent c8b6858716
commit 35f63bdc5f
5 changed files with 106 additions and 94 deletions

View File

@ -558,6 +558,14 @@ DLL_EXPORT void SpellCasted::applyGs( CGameState *gs )
{
gs->curB->castedSpells[side]++;
}
if(gs->curB && id == 35) //dispel
{
CStack *s = gs->curB->getStackT(tile);
if(s)
{
s->effects.clear(); //removing all effects
}
}
}
DLL_EXPORT void SetStackEffect::applyGs( CGameState *gs )
@ -567,14 +575,7 @@ DLL_EXPORT void SetStackEffect::applyGs( CGameState *gs )
CStack *s = gs->curB->getStack(id);
if(s)
{
if(effect.id == 35) //dispel - removing all effects
{
s->effects.clear();
}
else //adding effect
{
s->effects.push_back(effect);
}
s->effects.push_back(effect); //adding effect
}
else
tlog1 << "Cannot find stack " << id << std::endl;