Files
Super-Mario-Bros.-Remastere…/Scripts/Classes/CoinHeaven.gd
Tsank35 27ae3d5612 Room variation types (#517)
* Global.gd now has an extra variable for current room type

* ResourceSetterNew.gd now has variation category for room types

The state variable also had to include the room type, since it wouldn't update properly when entering a bonus room from a level that's already underground

* LevelClass.gd sets room type on update_theme

A new function, get_room_type() allows for the level's room type to be detected, which can easily be overwritten by other level classes. Bonus Rooms are detected by comparing the level's scene path to a pre-defined list of bonus rooms.

* Added get_room_type() to CoinHeaven.gd

* Added get_room_type() to PipeCutscene.gd

Also updates the room type in _enter_tree() since update_theme() isn't called here.

* Added get_room_type() to TitleScreen.gd
2025-10-06 22:05:43 +01:00

19 lines
499 B
GDScript

class_name CoinHeaven
extends Level
@export var all_coins_check: AllCoinsCollectedCheck = null
func _ready() -> void:
Level.in_vine_level = true
func warp_back(player: Player) -> void:
player.state_machine.transition_to("Freeze")
if all_coins_check != null:
await all_coins_check.check()
await get_tree().create_timer(1, false).timeout
PipeArea.exiting_pipe_id = -1
Global.transition_to_scene(Level.vine_return_level)
func get_room_type() -> Global.Room:
return Global.Room.COIN_HEAVEN