update tutors

This commit is contained in:
2026-04-23 18:22:37 +03:00
parent 794261e0d0
commit e3261f8e78
2 changed files with 18 additions and 9 deletions
-3
View File
@@ -23,6 +23,3 @@ func _process(delta: float) -> void:
func interact(player: Node) -> void: func interact(player: Node) -> void:
player.call("apply_upgrade_boots", 2.0, tier) player.call("apply_upgrade_boots", 2.0, tier)
queue_free() queue_free()
var mains := get_tree().get_nodes_in_group("main")
if not mains.is_empty():
mains[0].call("show_tutorial", "Tutorial_LeatherBoots")
+18 -6
View File
@@ -56,6 +56,7 @@ var _equip_prev_tiers: Array[int] = [-1, -1, -1]
# Boss phase # Boss phase
var boss_active: bool = false var boss_active: bool = false
var first_boss_spawned: bool = false var first_boss_spawned: bool = false
var first_bat_spawned: bool = false
var boss_timer: float = 90.0 var boss_timer: float = 90.0
var portal_node: Node3D = null var portal_node: Node3D = null
var boss_timer_label: Label var boss_timer_label: Label
@@ -277,6 +278,9 @@ func _spawn_enemy() -> void:
enemy.target = player enemy.target = player
enemy.connect("died", _on_enemy_died) enemy.connect("died", _on_enemy_died)
enemy.connect("merged", _on_enemy_merged) enemy.connect("merged", _on_enemy_merged)
if type == "bat" and not first_bat_spawned:
first_bat_spawned = true
show_tutorial("Tutorial_LeatherBoots")
if type == "ogre" and not first_boss_spawned: if type == "ogre" and not first_boss_spawned:
first_boss_spawned = true first_boss_spawned = true
_start_boss_phase() _start_boss_phase()
@@ -394,9 +398,11 @@ func _pick_upgrade(id: String) -> void:
func _show_gameover() -> void: func _show_gameover() -> void:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
gameover_panel.visible = true
var lbl := gameover_panel.get_node("VBox/ScoreLabel") as Label var lbl := gameover_panel.get_node("VBox/ScoreLabel") as Label
lbl.text = "Score: %d\nWave: %d" % [score, wave] lbl.text = "Score: %d\nWave: %d" % [score, wave]
show_tutorial("LoseGame", func() -> void:
gameover_panel.visible = true
)
func _restart() -> void: func _restart() -> void:
get_tree().paused = false get_tree().paused = false
@@ -409,9 +415,11 @@ func _start_boss_phase() -> void:
return return
boss_active = true boss_active = true
boss_timer = 120.0 boss_timer = 120.0
boss_timer_label.visible = true
boss_hint_label.visible = true
_spawn_portal() _spawn_portal()
show_tutorial("ThirdLevelEnemy", func() -> void:
boss_timer_label.visible = true
boss_hint_label.visible = true
)
func _spawn_portal() -> void: func _spawn_portal() -> void:
portal_node = Node3D.new() portal_node = Node3D.new()
@@ -506,9 +514,11 @@ func _trigger_win() -> void:
if is_instance_valid(portal_node): if is_instance_valid(portal_node):
portal_node.queue_free() portal_node.queue_free()
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
get_tree().paused = true
win_panel.visible = true
(win_panel.get_node("VBox/ScoreLabel") as Label).text = "Score: %d\nWave: %d" % [score, wave] (win_panel.get_node("VBox/ScoreLabel") as Label).text = "Score: %d\nWave: %d" % [score, wave]
show_tutorial("VictoryScreen", func() -> void:
get_tree().paused = true
win_panel.visible = true
)
func _trigger_time_up() -> void: func _trigger_time_up() -> void:
if not boss_active: if not boss_active:
@@ -585,8 +595,10 @@ func _set_player_paused(paused: bool) -> void:
for e in get_tree().get_nodes_in_group("player"): for e in get_tree().get_nodes_in_group("player"):
(e as Node).process_mode = mode (e as Node).process_mode = mode
const _REPEATABLE_TUTORIALS := ["VictoryScreen", "LoseGame"]
func show_tutorial(key: String, on_dismiss: Callable = Callable()) -> void: func show_tutorial(key: String, on_dismiss: Callable = Callable()) -> void:
if shown_tutorials.get(key, false): if shown_tutorials.get(key, false) and not key in _REPEATABLE_TUTORIALS:
if on_dismiss.is_valid(): if on_dismiss.is_valid():
on_dismiss.call() on_dismiss.call()
return return