@@ -18,14 +18,14 @@ func on_player_win(time: Array[int], death_count: int):
1818
1919func open (time : Array [int ], death_count : int ):
2020 MusicManager .stop ()
21+
2122 Input .mouse_mode = Input .MOUSE_MODE_VISIBLE
22- if PlayerSkinManager .current_skin == "mexican_player" && PlayerHatManager .current_hat == "mexican_hat" :
23- mexican_mode ()
23+ var mexican_mode : bool = PlayerSkinManager .current_skin == "mexican_player" && \
24+ PlayerHatManager .current_hat == "mexican_hat"
25+
2426 get_tree ().paused = true
2527 Game .can_pause = false
26- var time_sum : int = 0
27- for i in time :
28- time_sum += i
28+
2929 player_status_ui .visible = false
3030 singleplayer .visible = true
3131
@@ -34,7 +34,11 @@ func open(time: Array[int], death_count: int):
3434 var music_id : String = "level_win_" + Level .level_theme_to_str (level_theme )
3535 if is_best_time :
3636 music_id += "_variant"
37- MusicManager .play_music (music_id )
37+ if mexican_mode :
38+ MusicManager .play_music ("mexican_music" )
39+ Game .instanceNodeAtPos (load ("res://scenes/bundles/particles/tacosParticle.tscn" ), self , Vector2 (0 , - 100 ))
40+ else :
41+ MusicManager .play_music (music_id )
3842
3943 if LevelManager .is_default_level (LevelManager .current_level ):
4044 var current_level_number : int = int (LevelManager .current_level .replace ("level_" , "" ))
@@ -48,6 +52,10 @@ func open(time: Array[int], death_count: int):
4852 time_label .start (time , death_count )
4953 await best_time_animation .animation_finished
5054
55+ var time_sum : int = 0
56+ for i in time :
57+ time_sum += i
58+
5159 if is_best_time :
5260 if LevelManager .get_level_best_time (LevelManager .current_level ) != [0 , 0 , 0 ]:
5361 LootBoxesManager .add_loot_box (0 , true )
@@ -58,10 +66,6 @@ func open(time: Array[int], death_count: int):
5866 else :
5967 LootBoxesManager .add_loot_box ((time_sum * time_sum ) / pow (3 * 99 , 2 ))
6068
61- func mexican_mode ():
62- MusicManager .play_music ("mexican_music" )
63- Game .instanceNodeAtPos (load ("res://scenes/bundles/particles/tacosParticle.tscn" ), self , Vector2 (0 , - 100 ))
64-
6569func exit ():
6670 LevelManager .current_level = ""
6771 Game .can_pause = true
0 commit comments