1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

* added native terrain bonuses in battles

* number of units in stack in battle should now fit the box
* non-living and undead creatures have now always 0 morale
This commit is contained in:
mateuszb
2009-06-30 12:28:22 +00:00
parent 97287bb7d1
commit 1cac083239
8 changed files with 64 additions and 12 deletions

View File

@@ -934,6 +934,18 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
stacks[g]->position -= 1;
}
}
//adding native terrain bonuses
for(int g=0; g<stacks.size(); ++g)
{
if( VLC->heroh->nativeTerrains[stacks[g]->creature->faction] == gs->map->terrain[tile.x][tile.y][tile.z].tertype )
{
stacks[g]->features.push_back(makeFeature(StackFeature::SPEED_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
stacks[g]->features.push_back(makeFeature(StackFeature::ATTACK_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
stacks[g]->features.push_back(makeFeature(StackFeature::DEFENCE_BONUS, StackFeature::WHOLE_BATTLE, 0, 1, StackFeature::OTHER_SOURCE));
}
}
//adding war machines
if(hero1)
{