1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Merge remote-tracking branch 'mckibbenta/tgm'

This commit is contained in:
Marc Zinnschlag 2013-09-19 15:14:35 +02:00
commit 99fe6e68c7
5 changed files with 18 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,8 @@ namespace MWMechanics
continue; continue;
} }
// workaround: always keep player alive for now // If it's the player and God Mode is turned on, keep it alive
// \todo remove workaround, once player death can be handled if(iter->first.getRefData().getHandle()=="player" && MWBase::Environment::get().getWorld()->getGodModeState())
if(iter->first.getRefData().getHandle()=="player")
{ {
MWMechanics::DynamicStat<float> stat(stats.getHealth()); MWMechanics::DynamicStat<float> stat(stats.getHealth());

View File

@ -726,8 +726,7 @@ namespace MWScript
bool enabled = MWBase::Environment::get().getWorld()->toggleGodMode(); bool enabled = MWBase::Environment::get().getWorld()->toggleGodMode();
// context.report (enabled ? "God Mode -> On" : "God Mode -> Off"); context.report (enabled ? "God Mode -> On" : "God Mode -> Off");
context.report("Unimplemented");
} }
}; };

View File

@ -170,7 +170,7 @@ namespace MWWorld
mSky (true), mCells (mStore, mEsm), mSky (true), mCells (mStore, mEsm),
mActivationDistanceOverride (mActivationDistanceOverride), mActivationDistanceOverride (mActivationDistanceOverride),
mFallback(fallbackMap), mPlayIntro(0), mTeleportEnabled(true), mFallback(fallbackMap), mPlayIntro(0), mTeleportEnabled(true),
mFacedDistance(FLT_MAX) mFacedDistance(FLT_MAX), mGodMode(false)
{ {
mPhysics = new PhysicsSystem(renderer); mPhysics = new PhysicsSystem(renderer);
mPhysEngine = mPhysics->getEngine(); mPhysEngine = mPhysics->getEngine();
@ -1948,9 +1948,16 @@ 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()
{ {
return false; mGodMode = !mGodMode;
return mGodMode;
} }
} }

View File

@ -68,6 +68,8 @@ namespace MWWorld
OEngine::Physic::PhysicEngine* mPhysEngine; OEngine::Physic::PhysicEngine* mPhysEngine;
bool mGodMode;
// not implemented // not implemented
World (const World&); World (const World&);
World& operator= (const World&); World& operator= (const World&);
@ -440,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();
}; };
} }