mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 07:39:40 +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 timeDiff = std::min(7.f, std::max(0.f, std::abs(time - 13)));
|
||||||
float damageScale = 1.f - timeDiff / 7.f;
|
float damageScale = 1.f - timeDiff / 7.f;
|
||||||
// When cloudy, the sun damage effect is halved
|
// 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();
|
int weather = MWBase::Environment::get().getWorld()->getCurrentWeather();
|
||||||
if (weather > 1)
|
if (weather > 1)
|
||||||
damageScale *= 0.5;
|
damageScale *= fMagicSunBlockedMult;
|
||||||
health.setCurrent(health.getCurrent() - magnitude * duration * damageScale);
|
health.setCurrent(health.getCurrent() - magnitude * duration * damageScale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue