Merge remote-tracking branch 'mckibbenta/tgm'

actorid
Marc Zinnschlag 11 years ago
commit 99fe6e68c7

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

@ -275,9 +275,8 @@ namespace MWMechanics
continue;
}
// workaround: always keep player alive for now
// \todo remove workaround, once player death can be handled
if(iter->first.getRefData().getHandle()=="player")
// If it's the player and God Mode is turned on, keep it alive
if(iter->first.getRefData().getHandle()=="player" && MWBase::Environment::get().getWorld()->getGodModeState())
{
MWMechanics::DynamicStat<float> stat(stats.getHealth());

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

@ -170,7 +170,7 @@ namespace MWWorld
mSky (true), mCells (mStore, mEsm),
mActivationDistanceOverride (mActivationDistanceOverride),
mFallback(fallbackMap), mPlayIntro(0), mTeleportEnabled(true),
mFacedDistance(FLT_MAX)
mFacedDistance(FLT_MAX), mGodMode(false)
{
mPhysics = new PhysicsSystem(renderer);
mPhysEngine = mPhysics->getEngine();
@ -1948,9 +1948,16 @@ namespace MWWorld
stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0);
}
bool World::getGodModeState()
{
return mGodMode;
}
bool World::toggleGodMode()
{
return false;
mGodMode = !mGodMode;
return mGodMode;
}
}

@ -68,6 +68,8 @@ namespace MWWorld
OEngine::Physic::PhysicEngine* mPhysEngine;
bool mGodMode;
// not implemented
World (const World&);
World& operator= (const World&);
@ -440,6 +442,8 @@ namespace MWWorld
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor);
virtual bool getGodModeState();
virtual bool toggleGodMode();
};
}

Loading…
Cancel
Save