mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 20:56:42 +00:00 
			
		
		
		
	Merge remote-tracking branch 'mckibbenta/tgm'
This commit is contained in:
		
						commit
						bf8a25c2c6
					
				
					 8 changed files with 31 additions and 4 deletions
				
			
		|  | @ -395,6 +395,8 @@ 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; | ||||
| 
 | ||||
|             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,20 @@ 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");
 | ||||
|                     context.report("Unimplemented"); | ||||
|                 } | ||||
|         }; | ||||
| 
 | ||||
| 
 | ||||
|         void installOpcodes (Interpreter::Interpreter& interpreter) | ||||
|         { | ||||
|  | @ -775,6 +789,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>);            | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -1160,7 +1160,7 @@ namespace MWWorld | |||
| 
 | ||||
|     bool World::toggleCollisionMode() | ||||
|     { | ||||
|         return mPhysics->toggleCollisionMode();; | ||||
|         return mPhysics->toggleCollisionMode(); | ||||
|     } | ||||
| 
 | ||||
|     bool World::toggleRenderMode (RenderMode mode) | ||||
|  | @ -1948,4 +1948,9 @@ namespace MWWorld | |||
|         stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0); | ||||
|     } | ||||
| 
 | ||||
|     bool World::toggleGodMode() | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -439,6 +439,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…
	
		Reference in a new issue