1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

7 days without castle loss condition. Minor fixes.

This commit is contained in:
Michał W. Urbańczyk
2010-02-01 23:30:03 +00:00
parent 172b3b0158
commit 49e56e3749
6 changed files with 81 additions and 13 deletions

View File

@ -575,6 +575,15 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
if(gs->getDate(1) == 7) //new week
BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
h->bonuses.remove_if(HeroBonus::OneWeek);
//count days without town
for( std::map<ui8, PlayerState>::iterator i=gs->players.begin() ; i!=gs->players.end();i++)
{
if(i->second.towns.size() || gs->day == 1)
i->second.daysWithoutCastle = 0;
else
i->second.daysWithoutCastle++;
}
}
DLL_EXPORT void SetObjectProperty::applyGs( CGameState *gs )