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

Reworked & fixed DARKNESS bonuses and lookout tower / skyship logic

This commit is contained in:
Ivan Savenko
2025-06-09 13:50:45 +03:00
parent a305ed28bb
commit e0de65d56c
19 changed files with 102 additions and 87 deletions

View File

@@ -11,6 +11,7 @@
#include "StdInc.h"
#include "CGTownInstance.h"
#include "IGameSettings.h"
#include "TownBuildingInstance.h"
#include "../spells/CSpellHandler.h"
#include "../bonuses/Bonus.h"
@@ -42,17 +43,10 @@
VCMI_LIB_NAMESPACE_BEGIN
int CGTownInstance::getSightRadius() const //returns sight distance
int CGTownInstance::getSightRadius() const
{
auto ret = CBuilding::HEIGHT_NO_TOWER;
for(const auto & bid : builtBuildings)
{
auto height = getTown()->buildings.at(bid)->height;
if(ret < height)
ret = height;
}
return ret;
int baseValue = LIBRARY->engineSettings()->getInteger(EGameSettings::TOWNS_BASE_SCOUNTING_RANGE);
return applyBonuses(BonusType::SIGHT_RADIUS, baseValue);
}
void CGTownInstance::setPropertyDer(ObjProperty what, ObjPropertyID identifier)