diff --git a/scripts/commands/setgodmode.py b/scripts/commands/setgodmode.py new file mode 100644 index 00000000..d8b9647d --- /dev/null +++ b/scripts/commands/setgodmode.py @@ -0,0 +1,39 @@ +import sys +from engine.resources.scene import Point3D + +def setup(): + return + +def run(core, actor, target, commandString): + + playerObject = actor.getSlottedObject('ghost') + + if not playerObject: + return + + commandArgs = commandString.split(' ') + command = commandArgs[0] + arg1 = commandArgs[1] + if commandArgs[2]: + arg2 = commandArgs[2] + if commandArgs[3]: + arg3 = commandArgs[3] + if commandArgs[4]: + arg4 = commandArgs[4] + + if not command: + return + + if command == 'giveExperience' and arg1: + core.playerService.giveExperience(actor, int(arg1)) + + if command == 'setSpeed' and arg1: + actor.sendSystemMessage('Your speed was ' + str(actor.getSpeedMultiplierBase()) + '. Don\'t forget to set this back or it\'ll permanently imbalance your speed. Default without buffs or mods is 1.', 2) + actor.setSpeedMultiplierBase(float(arg1)) + actor.sendSystemMessage('Your new speed is ' + str(actor.getSpeedMultiplierBase()) + '.', 2) + + if command == 'teleport' and arg2 and arg3 and arg4: + position = Point3D(float(arg2), float(arg3), float(arg4)) + core.simulationService.transferToPlanet(actor, core.terrainService.getPlanetByName(arg1), position, actor.getOrientation(), None) + + return diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index cfd1671b..009614bd 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -141,6 +141,7 @@ public class SimulationService implements INetworkDispatch { core.commandService.registerCommand("boardshuttle"); core.commandService.registerCommand("getplayerid"); core.commandService.registerCommand("inspire"); + core.commandService.registerCommand("setgodmode"); }