1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 10:06:42 +00:00

Initial toggleGodMod/tgm instruction. Currently only affects player health.

This commit is contained in:
mckibbenta 2013-09-12 08:30:00 -04:00
parent 85b8af6262
commit 89b7d6121d
4 changed files with 11 additions and 7 deletions

View file

@ -396,6 +396,8 @@ namespace MWBase
/// It only applies to the current form the NPC is in. /// It only applies to the current form the NPC is in.
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) = 0; virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) = 0;
virtual bool getGodModeState() = 0;
virtual bool toggleGodMode() = 0; virtual bool toggleGodMode() = 0;
}; };
} }

View file

@ -275,9 +275,7 @@ namespace MWMechanics
continue; continue;
} }
// workaround: always keep player alive for now if(iter->first.getRefData().getHandle()=="player" && MWBase::Environment::get().getWorld()->getGodModeState())
// \todo remove workaround, once player death can be handled
if(iter->first.getRefData().getHandle()=="player" && false)
{ {
MWMechanics::DynamicStat<float> stat(stats.getHealth()); MWMechanics::DynamicStat<float> stat(stats.getHealth());

View file

@ -1948,12 +1948,14 @@ namespace MWWorld
stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0); stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0);
} }
bool World::getGodModeState()
{
return mGodMode;
}
bool World::toggleGodMode() bool World::toggleGodMode()
{ {
if (mGodMode) mGodMode ? mGodMode = false : mGodMode = true;
mGodMode = false;
else
mGodMode = true;
return mGodMode; return mGodMode;
} }

View file

@ -442,6 +442,8 @@ namespace MWWorld
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor); virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor);
virtual bool getGodModeState();
virtual bool toggleGodMode(); virtual bool toggleGodMode();
}; };
} }