1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Lookout Tower support

This commit is contained in:
DjWarmonger
2009-08-15 16:12:30 +00:00
parent 79362501c1
commit f9881af0a6

View File

@ -1173,6 +1173,8 @@ void CGDwelling::fightOver(const CGHeroInstance *h, BattleResult *result) const
int CGTownInstance::getSightRadious() const //returns sight distance int CGTownInstance::getSightRadious() const //returns sight distance
{ {
if (subID == 2 && (builtBuildings.find(21))!=builtBuildings.end())
return 20;
return 5; return 5;
} }
@ -2660,6 +2662,20 @@ void CGBonusingObject::onHeroVisit( const CGHeroInstance * h ) const
break; break;
case 94: //Stables TODO: upgrade Cavaliers case 94: //Stables TODO: upgrade Cavaliers
sound = soundBase::horse20; sound = soundBase::horse20;
std::set<ui32> slots;
for (std::map<si32,std::pair<ui32,si32> >::const_iterator i = h->army.slots.begin(); i != h->army.slots.end(); ++i)
{
if(i->second.first == 10)
slots.insert(i->first);
}
if (!slots.empty())
{
for (std::set<ui32>::const_iterator i = slots.begin(); i != slots.end(); i++)
{
UpgradeCreature uc(*i, id, 11);
//uc.applyGh (&gh);
}
}
messageID = 137; messageID = 137;
gbonus.bonus.type = HeroBonus::LAND_MOVEMENT; gbonus.bonus.type = HeroBonus::LAND_MOVEMENT;
gbonus.bonus.val = 600; gbonus.bonus.val = 600;