mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 05:45:35 +00:00
Use GMST for sun damage reduction
This commit is contained in:
parent
bda28e2ed0
commit
49ea1aae67
1 changed files with 4 additions and 1 deletions
|
@ -258,9 +258,12 @@ namespace MWMechanics
|
|||
float timeDiff = std::min(7.f, std::max(0.f, std::abs(time - 13)));
|
||||
float damageScale = 1.f - timeDiff / 7.f;
|
||||
// When cloudy, the sun damage effect is halved
|
||||
static float fMagicSunBlockedMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
|
||||
"fMagicSunBlockedMult")->getFloat();
|
||||
|
||||
int weather = MWBase::Environment::get().getWorld()->getCurrentWeather();
|
||||
if (weather > 1)
|
||||
damageScale *= 0.5;
|
||||
damageScale *= fMagicSunBlockedMult;
|
||||
health.setCurrent(health.getCurrent() - magnitude * duration * damageScale);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue