1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

* massive spells go via one SetStackEffect

This commit is contained in:
mateuszb
2009-03-21 16:03:07 +00:00
parent b2c4f3e0fd
commit 2a7ad63495
8 changed files with 67 additions and 123 deletions

View File

@@ -2226,30 +2226,30 @@ void CGameHandler::makeCustomAction( BattleAction &ba )
//TODO: check resistances
#define SPELL_CAST_TEMPLATE_1(NUMBER, DURATION) SetStackEffect sse; \
if(getSchoolLevel(h,s) < 3) /*not expert */ \
if(getSchoolLevel(h,s) < 3) /*not expert */ \
{ \
sse.stacks.insert(gs->curB->getStackT(ba.destinationTile)->ID); \
sse.effect.id = (NUMBER); \
sse.effect.level = getSchoolLevel(h,s); \
sse.effect.turnsRemain = (DURATION); /*! - any duration */ \
sendAndApply(&sse); \
sse.stacks.insert(gs->curB->getStackT(ba.destinationTile)->ID); \
sse.effect.id = (NUMBER); \
sse.effect.level = getSchoolLevel(h,s); \
sse.effect.turnsRemain = (DURATION); /*! - any duration */ \
sendAndApply(&sse); \
} \
else \
{ \
for(int it=0; it<gs->curB->stacks.size(); ++it) \
{ \
/*if it's non negative spell and our unit or non positive spell and hostile unit */ \
if((VLC->spellh->spells[ba.additionalInfo].positiveness >= 0 && gs->curB->stacks[it]->owner == h->tempOwner) \
||(VLC->spellh->spells[ba.additionalInfo].positiveness <= 0 && gs->curB->stacks[it]->owner != h->tempOwner ) \
) \
{ \
sse.stacks.insert(gs->curB->stacks[it]->ID); \
sse.effect.id = (NUMBER); \
sse.effect.level = getSchoolLevel(h,s); \
sse.effect.turnsRemain = (DURATION); \
sendAndApply(&sse); \
} \
} \
for(int it=0; it<gs->curB->stacks.size(); ++it) \
{ \
/*if it's non negative spell and our unit or non positive spell and hostile unit */ \
if((VLC->spellh->spells[ba.additionalInfo].positiveness >= 0 && gs->curB->stacks[it]->owner == h->tempOwner) \
||(VLC->spellh->spells[ba.additionalInfo].positiveness <= 0 && gs->curB->stacks[it]->owner != h->tempOwner ) \
) \
{ \
sse.stacks.insert(gs->curB->stacks[it]->ID); \
} \
} \
sse.effect.id = (NUMBER); \
sse.effect.level = getSchoolLevel(h,s); \
sse.effect.turnsRemain = (DURATION); \
sendAndApply(&sse); \
}
SpellCasted sc;