From 568d45ee31fa3f3690e71a5ce18c229bcb5af914 Mon Sep 17 00:00:00 2001 From: John Cooper McDonald Date: Sat, 18 Oct 2025 08:42:51 -0500 Subject: [PATCH] Change 1-up flagpole to replace the 5000 point bonus (#550) * Change 1-up flagpole to replace the 5000 point bonus * Also no 1-ups in you vs boo * Update EndFlagpole.gd * Style * Update EndFlagpole.tscn --- Scenes/Prefabs/LevelObjects/EndFlagpole.tscn | 16 +------------- .../Classes/Entities/Items/SuperMushroom.gd | 4 ++-- Scripts/Classes/Entities/Player.gd | 2 +- Scripts/Classes/Entities/ShellClass.gd | 2 +- Scripts/Parts/EndCastle.gd | 8 +++++-- Scripts/Parts/EndFlagpole.gd | 21 +++++++------------ 6 files changed, 18 insertions(+), 35 deletions(-) diff --git a/Scenes/Prefabs/LevelObjects/EndFlagpole.tscn b/Scenes/Prefabs/LevelObjects/EndFlagpole.tscn index bd56e79..ca54d62 100644 --- a/Scenes/Prefabs/LevelObjects/EndFlagpole.tscn +++ b/Scenes/Prefabs/LevelObjects/EndFlagpole.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=24 format=3 uid="uid://c6loucilra6da"] +[gd_scene load_steps=22 format=3 uid="uid://c6loucilra6da"] [ext_resource type="Script" uid="uid://dwfnvpioh2kvi" path="res://Scripts/Parts/EndFlagpole.gd" id="1_3rtm4"] [ext_resource type="Texture2D" uid="uid://3vg41a5plc4e" path="res://Assets/Sprites/Tilesets/FlagPole.png" id="1_hnd65"] -[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="4_62gix"] [ext_resource type="JSON" path="res://Assets/Sprites/Tilesets/FlagPole.json" id="4_nykv5"] [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_dm4yn"] [ext_resource type="Script" uid="uid://cmvlgsjmsk0v5" path="res://Scripts/Classes/Resources/ThemedResource.gd" id="5_jihtx"] @@ -57,9 +56,6 @@ _data = { &"RESET": SubResource("Animation_xwflf") } -[sub_resource type="CircleShape2D" id="CircleShape2D_c56yc"] -radius = 4.0 - [sub_resource type="Animation" id="Animation_uwkl1"] length = 0.001 tracks/0/type = "value" @@ -170,14 +166,6 @@ libraries = { &"": SubResource("AnimationLibrary_62gix") } -[node name="Top" type="Area2D" parent="."] -script = ExtResource("4_62gix") -metadata/_custom_type_script = "uid://cnheej0sxmoxg" - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Top"] -position = Vector2(0, -164) -shape = SubResource("CircleShape2D_c56yc") - [node name="ScoreNoteSpawner" type="Node" parent="."] script = ExtResource("5_dm4yn") note_offset = Vector2(0, -160) @@ -211,5 +199,3 @@ json_file_path = "res://Assets/Sprites/Tilesets/FlagPole.json" metadata/_custom_type_script = "uid://cqif1li7otvpl" [connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"] -[connection signal="player_entered" from="Top" to="." method="on_player_entered"] -[connection signal="player_entered" from="Top" to="ScoreNoteSpawner" method="spawn_one_up_note" unbinds=1] diff --git a/Scripts/Classes/Entities/Items/SuperMushroom.gd b/Scripts/Classes/Entities/Items/SuperMushroom.gd index 1c39106..dee71b0 100644 --- a/Scripts/Classes/Entities/Items/SuperMushroom.gd +++ b/Scripts/Classes/Entities/Items/SuperMushroom.gd @@ -18,10 +18,10 @@ func on_area_entered(area: Area2D) -> void: func give_life(_player: Player) -> void: DiscoLevel.combo_amount += 1 AudioManager.play_sfx("1_up", global_position) - if Global.current_game_mode == Global.GameMode.CHALLENGE or Settings.file.difficulty.inf_lives: + if [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) or Settings.file.difficulty.inf_lives: Global.score += 2000 $ScoreNoteSpawner.spawn_note(2000) else: - $ScoreNoteSpawner.spawn_one_up_note() Global.lives += 1 + $ScoreNoteSpawner.spawn_one_up_note() queue_free() diff --git a/Scripts/Classes/Entities/Player.gd b/Scripts/Classes/Entities/Player.gd index a2a1bdd..dc717ad 100644 --- a/Scripts/Classes/Entities/Player.gd +++ b/Scripts/Classes/Entities/Player.gd @@ -445,7 +445,7 @@ func enemy_bounce_off(add_combo := true, award_score := true) -> void: func add_stomp_combo(award_score := true) -> void: if stomp_combo >= 10: if award_score: - if Global.current_game_mode == Global.GameMode.CHALLENGE or Settings.file.difficulty.inf_lives: + if [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_gamemode) or Settings.file.difficulty.inf_lives: Global.score += 10000 score_note_spawner.spawn_note(10000) else: diff --git a/Scripts/Classes/Entities/ShellClass.gd b/Scripts/Classes/Entities/ShellClass.gd index 3d21d9b..38758c5 100644 --- a/Scripts/Classes/Entities/ShellClass.gd +++ b/Scripts/Classes/Entities/ShellClass.gd @@ -67,7 +67,7 @@ func on_player_hit(hit_player: Player) -> void: func award_score(award_level: int) -> void: if award_level >= 10: - if Global.current_game_mode == Global.GameMode.CHALLENGE or Settings.file.difficulty.inf_lives: + if [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) or Settings.file.difficulty.inf_lives: $ScoreNoteSpawner.spawn_note(10000) else: AudioManager.play_global_sfx("1_up") diff --git a/Scripts/Parts/EndCastle.gd b/Scripts/Parts/EndCastle.gd index 4ef6d24..a331095 100644 --- a/Scripts/Parts/EndCastle.gd +++ b/Scripts/Parts/EndCastle.gd @@ -85,9 +85,13 @@ func do_lost_levels_firework_check() -> void: else: await show_fireworks(3) if Global.coins % 11 == 0: - spawn_one_up_note() AudioManager.play_sfx("1_up", global_position) - Global.lives += 1 + if [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) or Settings.file.difficulty.inf_lives: + Global.score += 2000 + $ScoreNoteSpawner.spawn_note(2000) + else: + Global.lives += 1 + spawn_one_up_note() const ONE_UP_NOTE = preload("uid://dopxwjj37gu0l") diff --git a/Scripts/Parts/EndFlagpole.gd b/Scripts/Parts/EndFlagpole.gd index 303cbe5..e2f9f9f 100644 --- a/Scripts/Parts/EndFlagpole.gd +++ b/Scripts/Parts/EndFlagpole.gd @@ -6,17 +6,10 @@ signal player_reached signal sequence_begin -func _ready() -> void: - if Settings.file.difficulty.flagpole_lives == 0: - print(Settings.file.difficulty) - $Top.queue_free() - func on_area_entered(area: Area2D) -> void: if area.owner is Player: player_touch(area.owner) - - func player_touch(player: Player) -> void: player_reached.emit() if Global.current_game_mode == Global.GameMode.MARATHON_PRACTICE: @@ -50,10 +43,10 @@ func give_points(player: Player) -> void: var value = clamp(int(lerp(0, 4, (player.global_position.y / -144))), 0, 4) var nearest_value = FLAG_POINTS[value] $Score.text = str(nearest_value) - Global.score += nearest_value - $Score/Animation2.play("ScoreRise") - -func on_player_entered(player: Player) -> void: - player_touch(player) - Global.lives += 1 - AudioManager.play_sfx("1_up", global_position) + if nearest_value == 5000 and Settings.file.difficulty.flagpole_lives and not [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) and not Settings.file.difficulty.inf_lives: + AudioManager.play_sfx("1_up", global_position) + Global.lives += 1 + $ScoreNoteSpawner.spawn_one_up_note() + else: + Global.score += nearest_value + $Score/Animation2.play("ScoreRise")