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

* support for cursed ground

This commit is contained in:
mateuszb
2009-07-22 09:31:20 +00:00
parent 1c2edcf496
commit 17064478fa
3 changed files with 34 additions and 4 deletions

View File

@@ -1148,6 +1148,31 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, const CCreatureSet
stacks[g]->features.push_back(makeFeature(StackFeature::MORALE_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
}
}
break;
}
case 22: //cursed ground
{
for(int g=0; g<stacks.size(); ++g) //no luck nor morale
{
stacks[g]->features.push_back(makeFeature(StackFeature::NO_MORALE, StackFeature::WHOLE_BATTLE, 0, 0, StackFeature::OTHER_SOURCE));
stacks[g]->features.push_back(makeFeature(StackFeature::NO_LUCK, StackFeature::WHOLE_BATTLE, 0, 0, StackFeature::OTHER_SOURCE));
}
const CGHeroInstance * cHero = NULL;
for(int i=0; i<2; ++i) //blocking spells above level 1
{
if(i == 0) cHero = hero1;
else cHero = hero2;
if(cHero == NULL) continue;
GiveBonus gs;
gs.bonus = HeroBonus(HeroBonus::ONE_BATTLE, HeroBonus::BLOCK_SPELLS_ABOVE_LEVEL, HeroBonus::OBJECT, 1, -1, "", bonusSubtype);
gs.hid = cHero->id;
sendAndApply(&gs);
}
break;
}
}