Add tentacled boss planet encounter
This commit is contained in:
parent
0f7edff15a
commit
40f284dcdd
38 changed files with 1051 additions and 19 deletions
37
boss/BossEncounter.gd
Normal file
37
boss/BossEncounter.gd
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
class_name BossEncounter
|
||||
extends Node2D
|
||||
|
||||
@onready var boss: Node2D = $Boss
|
||||
@onready var status_label: Label = $EncounterUI/StatusLabel
|
||||
@onready var hint_label: Label = $EncounterUI/HintLabel
|
||||
@onready var game_state: Node = get_node("/root/GameState")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# One persistent objective lets boss victory flow through the same conquest
|
||||
# state as authored capture-point maps without pretending the boss is a
|
||||
# configurable capture point.
|
||||
game_state.register_capture_points(game_state.planet_id, 1,
|
||||
game_state.planet_definition_id)
|
||||
if game_state.is_planet_conquered(game_state.planet_id):
|
||||
boss.suppress_as_defeated()
|
||||
status_label.text = "THE WARDEN IS DEAD"
|
||||
hint_label.text = ""
|
||||
return
|
||||
boss.defeated.connect(_on_boss_defeated)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not is_instance_valid(boss) or boss.phase == boss.Phase.DEFEATED:
|
||||
return
|
||||
var phase_name: String = "PHASE II · LASER STORM" \
|
||||
if boss.phase == boss.Phase.LASER_STORM else "PHASE I · HATCHLINGS"
|
||||
status_label.text = "THE WARDEN · %s · EYES %d/%d" % [
|
||||
phase_name, boss.eyes_destroyed, boss.EYE_COUNT]
|
||||
hint_label.text = "DESTROY GOLDEN HATCHLINGS · FOLLOW THEIR LIGHT · BREAK THE OPEN EYES"
|
||||
|
||||
|
||||
func _on_boss_defeated() -> void:
|
||||
game_state.mark_point_captured(game_state.planet_id, 0)
|
||||
status_label.text = "THE WARDEN IS DEAD · PLANET CONQUERED"
|
||||
hint_label.text = ""
|
||||
Loading…
Reference in a new issue