made it so certain cheats disallow you from submitting scores (fixes #215)

This commit is contained in:
pennyrigate 2023-12-02 22:04:25 -05:00
parent ee3e1dc650
commit b925b22333
3 changed files with 30 additions and 2 deletions

View file

@ -12,6 +12,9 @@ var lines: int = 0
var time: float = 0.0
var n: int = 0
var debug = false
var is_cheating = false
var reset_is_cheating = false
var allow_sword = false
var moon_jump = false
var cfox_mode = false
@ -103,18 +106,26 @@ func _enter_code():
"1989":
for enemy in get_tree().get_nodes_in_group("enemy"):
enemy.die()
is_cheating = true
reset_is_cheating = true
"PEN":
debug = true
is_cheating = true
reset_is_cheating = false
"6DOUBLOONS":
Console.print(get_tree().get_nodes_in_group("gold").size())
#Doesnt work
"EVILSBANE":
allow_sword = true
Input.action_press("sword")
is_cheating = true
reset_is_cheating = false
"REDFEATHER":
var player = get_tree().get_nodes_in_group("player").pop_back()
if player != null:
player.state_chart.set_guard_property("red_feather", true)
is_cheating = true
reset_is_cheating = false
"NIGHTCORE":
Engine.time_scale = 2
Audio.ac_music.pitch_scale = 2
@ -126,6 +137,8 @@ func _enter_code():
"CANYOUDUNK":
var player = get_tree().get_nodes_in_group("player").pop_back()
if player != null: Game.instance_node(preload("res://objects/environment/zball/zball.tscn"),player.global_position.x,player.global_position.y - 18.0,Game.get_map())
is_cheating = true
reset_is_cheating = true
"YUMMY":
var player = get_tree().get_nodes_in_group("player").pop_back()
if player != null:
@ -147,6 +160,8 @@ func _enter_code():
if player != null: player.sprite.material.set_shader_param("border_color",Color.blue)
"BEESKNEES":
Game.get_map().rotation_degrees = -2
is_cheating = true
reset_is_cheating = true
#doesnt work
"CFOX":
var player = get_tree().get_nodes_in_group("player").pop_back()
@ -154,12 +169,18 @@ func _enter_code():
player.cfox.visible = true
"BANDANA":
infinite_arrows = true
is_cheating = true
reset_is_cheating = false
"ESCARGOD":
var player = get_tree().get_nodes_in_group("player").pop_back()
player.state_chart.send_event("become_invulnerable")
is_cheating = true
reset_is_cheating = false
"GILLS":
var player = get_tree().get_nodes_in_group("player").pop_back()
player.underwater = false
is_cheating = true
reset_is_cheating = false
"CHORUS":
var music = AudioServer.get_bus_index("music")
AudioServer.set_bus_effect_enabled(music,0,true)
@ -190,11 +211,13 @@ func _enter_code():
dir.list_dir_end()
"SKELETON":
Game.keys = 50
is_cheating = true
reset_is_cheating = true
"WHATSTHATSMELL":
prey_slaughtered = true
"SUS":
var scrump = get_tree().get_nodes_in_group("scrump").pop_back()
scrump.sus_monster()
if scrump != null: scrump.sus_monster()
sus_monster = true
"FASTPUNISHMENT":
fast_punishment = 1

View file

@ -21,6 +21,7 @@ func _ready():
Audio.play_music(music)
Game.time = 0.0
Game.still_playing = true
if Debug.reset_is_cheating: Debug.is_cheating = false
func _physics_process(delta):
if Game.still_playing:

View file

@ -2,6 +2,7 @@ extends Node
const Text3D = preload("res://objects/hud/3d_text.tscn")
const SubmitScore = preload("res://menus/submit_score.tscn")
const LevelSelect := preload("res://menus/level_select_scholar.tscn")
onready var shards: Node2D = $ShardsAndBonuses/Shards
onready var score = $Score
@ -52,4 +53,7 @@ func final_score():
func _on_AnimationPlayer_animation_finished(anim_name):
Fade.fade_out(0.4)
yield(Fade, "fade_finished")
if Debug.is_cheating == false:
SceneManager.change_scene(SubmitScore.instance())
else:
SceneManager.change_scene(LevelSelect.instance())