2023-02-02 13:28:14 -07:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
var scenePlayground = "res://scenes/playground.tscn"
|
|
|
|
var sceneTutorial = "res://scenes/tutorial.tscn"
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
2023-07-15 20:45:16 -06:00
|
|
|
if not Global.consoleOpen:
|
|
|
|
self.queue_free()
|
|
|
|
if Input.is_action_just_pressed("console_send"):
|
|
|
|
Global.consoleCommand = $consoleEdit.text
|
|
|
|
print ("Console command run: ", Global.consoleCommand)
|
|
|
|
run_command(Global.consoleCommand)
|
2023-02-02 13:28:14 -07:00
|
|
|
|
|
|
|
func run_command(command):
|
|
|
|
if command == "tele playground":
|
|
|
|
get_tree().change_scene_to_file(scenePlayground)
|
|
|
|
Global.consoleOutput = "Teleported to Playground!"
|
|
|
|
elif command == "tele tutorial":
|
|
|
|
get_tree().change_scene_to_file(sceneTutorial)
|
|
|
|
Global.consoleOutput = "Teleported to Tutorial!"
|
|
|
|
elif command == "which scene":
|
|
|
|
Global.consoleOutput = get_tree().get_current_scene().get_name()
|
|
|
|
elif command == "iamgod":
|
|
|
|
if not Global.godMode:
|
|
|
|
Global.consoleOutput = "God mode activated"
|
|
|
|
Global.godMode = true
|
|
|
|
elif Global.godMode:
|
|
|
|
Global.consoleOutput = "God mode deactivated"
|
|
|
|
Global.godMode = false
|
|
|
|
elif command == "exit":
|
|
|
|
Global.consoleOutput = "Byeee loser"
|
|
|
|
get_tree().quit()
|
|
|
|
elif command == "paul":
|
|
|
|
Global.consoleOutput = "Yuppp that's me"
|
|
|
|
elif command == "jayden":
|
|
|
|
Global.consoleOutput = "That's the noob artist"
|
2023-02-07 13:22:31 -07:00
|
|
|
elif command == "resetvars":
|
|
|
|
Global.consoleOutput = "Reset variables"
|
|
|
|
Global.reset_variables()
|
|
|
|
elif command in ["suicide", "kill", "die"]:
|
|
|
|
Global.consoleOutput = "Oh you didn't want to die?"
|
|
|
|
Global.playerHealth = 0
|
2023-02-24 13:43:51 -07:00
|
|
|
elif command == "gps":
|
|
|
|
Global.consoleOutput = str(Global.get_node(Global.selfTeddy).global_position)
|
2023-04-11 22:37:15 -06:00
|
|
|
elif command == "toggleHUD":
|
|
|
|
Global.consoleOutput = "HUD toggled!"
|
|
|
|
var HUD = get_node(str(Global.currentMapNode.get_path()) + str("/HUD"))
|
|
|
|
print(str(Global.currentMapNode.get_path()) + str("/HUD"))
|
|
|
|
if HUD.visible == true:
|
|
|
|
HUD.visible = false
|
|
|
|
elif HUD.visible == false:
|
|
|
|
HUD.visible = true
|
2023-05-11 09:46:11 -06:00
|
|
|
toggle_gun()
|
2023-02-02 13:28:14 -07:00
|
|
|
else:
|
|
|
|
Global.consoleOutput = "Unknown cheat code"
|
|
|
|
$output.text = Global.consoleOutput
|
2023-05-11 09:46:11 -06:00
|
|
|
|
|
|
|
func toggle_gun():
|
|
|
|
var map = Global.currentMapNode.get_path()
|
|
|
|
var playerID = Global.teddyAuthorityID
|
|
|
|
var gun = get_node(str(map) + '/' + str(playerID) + '/CollisionShape3D/Neck/Camera3D/Gun')
|
|
|
|
if gun.visible == true:
|
|
|
|
gun.visible = false
|
|
|
|
elif gun.visible == false:
|
|
|
|
gun.visible = true
|