cfox cheat works now (fixes #187)

This commit is contained in:
pennyrigate 2023-10-08 21:43:13 -04:00
parent 17aabe2eb9
commit 876dabddda
3 changed files with 22 additions and 10 deletions

View file

@ -144,7 +144,9 @@ func _enter_code():
Game.get_map().rotation_degrees = -2 Game.get_map().rotation_degrees = -2
#doesnt work #doesnt work
"CFOX": "CFOX":
cfox_mode = true var player = get_tree().get_nodes_in_group("player").pop_back()
player.sprite.visible = false
player.cfox.visible = true
"BANDANA": "BANDANA":
infinite_arrows = true infinite_arrows = true
"ESCARGOD": "ESCARGOD":
@ -177,6 +179,7 @@ func _enter_code():
var texture = load("res://graphics/player/palettes/" + file_name) var texture = load("res://graphics/player/palettes/" + file_name)
# add step to the tween for that texture # add step to the tween for that texture
tween.tween_property(player.sprite, "material:shader_param/palette", texture, 0.0) tween.tween_property(player.sprite, "material:shader_param/palette", texture, 0.0)
tween.tween_property(player.cfox, "material:shader_param/palette", texture, 0.0)
tween.tween_interval(0.2) tween.tween_interval(0.2)
file_name = dir.get_next() file_name = dir.get_next()
dir.list_dir_end() dir.list_dir_end()

View file

@ -61,12 +61,14 @@ onready var oxygen_timer = $OxygenTimer
onready var low_oxygen_label = $"%LowOxygenLabel" onready var low_oxygen_label = $"%LowOxygenLabel"
onready var edge_detector = $Graphics/EdgeDetector onready var edge_detector = $Graphics/EdgeDetector
onready var body_shape: CollisionShape2D = $"%BodyShape" onready var body_shape: CollisionShape2D = $"%BodyShape"
onready var cfox: Sprite = $"%CFox"
# OVERRIDES # # OVERRIDES #
func _ready() -> void: func _ready() -> void:
#set palette #set palette
var palette = load("res://graphics/player/palettes/%s.png" % Game.current_palette) var palette = load("res://graphics/player/palettes/%s.png" % Game.current_palette)
sprite.material.set_shader_param("palette", palette) sprite.material.set_shader_param("palette", palette)
$Graphics/CFox.material.set_shader_param("palette", palette)
# death handling # death handling
Game.respawn_point = global_position Game.respawn_point = global_position
connect("died", Game, "_on_player_died") connect("died", Game, "_on_player_died")
@ -128,12 +130,6 @@ func _physics_process(delta: float) -> void:
#NOT UNDERWATER #NOT UNDERWATER
low_oxygen_label.text = "" low_oxygen_label.text = ""
#Cheats
#CFox mode
if Debug.cfox_mode == true:
animation_player.play("idle")
animation_player.set_speed_scale(0)
# HELPER FUNCTIONS # # HELPER FUNCTIONS #
## spawns an arrow ## spawns an arrow

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=52 format=2] [gd_scene load_steps=53 format=2]
[ext_resource path="res://objects/player/player.gd" type="Script" id=1] [ext_resource path="res://objects/player/player.gd" type="Script" id=1]
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2] [ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2]
@ -38,6 +38,12 @@ shader_param/palette = ExtResource( 2 )
[sub_resource type="Curve" id=13] [sub_resource type="Curve" id=13]
_data = [ Vector2( 0, 1 ), 0.0, -0.0636948, 0, 0, Vector2( 1, 0 ), -3.43886, 0.0, 0, 0 ] _data = [ Vector2( 0, 1 ), 0.0, -0.0636948, 0, 0, Vector2( 1, 0 ), -3.43886, 0.0, 0, 0 ]
[sub_resource type="ShaderMaterial" id=24]
shader = ExtResource( 3 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = true
shader_param/palette = ExtResource( 2 )
[sub_resource type="RectangleShape2D" id=2] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 2.5, 5 ) extents = Vector2( 2.5, 5 )
@ -1099,6 +1105,13 @@ enabled = true
cast_to = Vector2( 0, 5 ) cast_to = Vector2( 0, 5 )
collision_mask = 5 collision_mask = 5
[node name="CFox" type="Sprite" parent="Graphics"]
unique_name_in_owner = true
visible = false
material = SubResource( 24 )
position = Vector2( 0, -10 )
texture = ExtResource( 4 )
[node name="BodyShape" type="CollisionShape2D" parent="."] [node name="BodyShape" type="CollisionShape2D" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
position = Vector2( 0.5, -5 ) position = Vector2( 0.5, -5 )
@ -1591,8 +1604,8 @@ align = 1
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"]
@ -1611,8 +1624,8 @@ align = 1
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Climbing" to="." method="_process_climbing"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Climbing" to="." method="_process_climbing"]
[connection signal="state_entered" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]