1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Implemented spell countering.

This commit is contained in:
Michał W. Urbańczyk
2012-09-13 23:41:03 +00:00
parent 96a92d0f45
commit 74f9c19a7c
4 changed files with 40 additions and 27 deletions

View File

@@ -354,14 +354,17 @@ void CSpellHandler::loadSpells()
{
//reading exact info
int spellID = spell["id"].Float();
CSpell *s = spells[spellID];
spells[spellID]->positiveness = spell["effect"].Float();
spells[spellID]->mainEffectAnim = spell["anim"].Float();
s->positiveness = spell["effect"].Float();
s->mainEffectAnim = spell["anim"].Float();
spells[spellID]->range.resize(4);
s->range.resize(4);
int idx = 0;
BOOST_FOREACH(const JsonNode &range, spell["ranges"].Vector())
spells[spellID]->range[idx++] = range.String();
s->range[idx++] = range.String();
s->counteredSpells = spell["counters"].StdVector<TSpell>();
}
spells.push_back(spells[80]); //clone Acid Breath attributes for Acid Breath damage effect