mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
initial do-nothing implementation; registered opcode
This commit is contained in:
parent
2823e5693d
commit
8998b90e8b
@ -394,6 +394,9 @@ namespace MWBase
|
||||
/// Sets the NPC's Acrobatics skill to match the fWerewolfAcrobatics GMST.
|
||||
/// It only applies to the current form the NPC is in.
|
||||
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) = 0;
|
||||
|
||||
// Dummy Implementation
|
||||
virtual bool toggleGodMode() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -351,5 +351,6 @@ op 0x200021b: SetWerewolfAcrobatics
|
||||
op 0x200021c: SetWerewolfAcrobaticsExplicit
|
||||
op 0x200021d: ShowVars
|
||||
op 0x200021e: ShowVarsExplicit
|
||||
op 0x200021f: ToggleGodMode
|
||||
|
||||
opcodes 0x200021f-0x3ffffff unused
|
||||
opcodes 0x2000220-0x3ffffff unused
|
||||
|
@ -717,6 +717,19 @@ namespace MWScript
|
||||
}
|
||||
};
|
||||
|
||||
class OpToggleGodMode : public Interpreter::Opcode0
|
||||
{
|
||||
public:
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
InterpreterContext& context = static_cast<InterpreterContext&> (runtime.getContext());
|
||||
|
||||
bool enabled = MWBase::Environment::get().getWorld()->toggleGodMode();
|
||||
|
||||
context.report (enabled ? "God Mode -> On" : "God Mode -> Off");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
{
|
||||
@ -775,6 +788,7 @@ namespace MWScript
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeEnableTeleporting, new OpEnableTeleporting<true>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeToggleGodMode, new OpToggleGodMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1081,7 +1081,6 @@ namespace MWScript
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
{
|
||||
for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i)
|
||||
@ -1207,7 +1206,7 @@ namespace MWScript
|
||||
interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolf, new OpSetWerewolf<ImplicitRef, false>);
|
||||
interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolfExplicit, new OpSetWerewolf<ExplicitRef, false>);
|
||||
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobatics, new OpSetWerewolfAcrobatics<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit, new OpSetWerewolfAcrobatics<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit, new OpSetWerewolfAcrobatics<ExplicitRef>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1154,7 +1154,7 @@ namespace MWWorld
|
||||
|
||||
bool World::toggleCollisionMode()
|
||||
{
|
||||
return mPhysics->toggleCollisionMode();;
|
||||
return mPhysics->toggleCollisionMode();
|
||||
}
|
||||
|
||||
bool World::toggleRenderMode (RenderMode mode)
|
||||
@ -1942,4 +1942,9 @@ namespace MWWorld
|
||||
stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0);
|
||||
}
|
||||
|
||||
bool World::toggleGodMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -438,6 +438,8 @@ namespace MWWorld
|
||||
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf);
|
||||
|
||||
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor);
|
||||
|
||||
virtual bool toggleGodMode();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -258,6 +258,8 @@ namespace Compiler
|
||||
extensions.registerInstruction ("enableteleporting", "", opcodeEnableTeleporting);
|
||||
extensions.registerInstruction ("showvars", "", opcodeShowVars, opcodeShowVarsExplicit);
|
||||
extensions.registerInstruction ("sv", "", opcodeShowVars, opcodeShowVarsExplicit);
|
||||
extensions.registerInstruction("tgm", "", opcodeToggleGodMode);
|
||||
extensions.registerInstruction("togglegodmode", "", opcodeToggleGodMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,6 +221,7 @@ namespace Compiler
|
||||
const int opcodeEnableTeleporting = 0x2000216;
|
||||
const int opcodeShowVars = 0x200021d;
|
||||
const int opcodeShowVarsExplicit = 0x200021e;
|
||||
const int opcodeToggleGodMode = 0x200021f;
|
||||
}
|
||||
|
||||
namespace Sky
|
||||
|
Loading…
x
Reference in New Issue
Block a user