Wire quest flow and combat across all levels.

Connect bear-save, massage, farm paywall, cheese catapults, Dressler hijack, final boss phases, fat-stim UI, and scene fixes so the satire path plays through.
This commit is contained in:
copilot 2026-09-14 19:08:00 +02:00
parent 938cc4bc82
commit 1d9e0a6532
51 changed files with 1899 additions and 251 deletions

View file

@ -13,8 +13,11 @@ extends CanvasLayer
@onready var music_slider: HSlider = $PausePanel/Margin/VBox/MusicSlider
@onready var lang_option: OptionButton = $PausePanel/Margin/VBox/LangOption
@onready var hp_label: Label = $HUD/HpLabel
@onready var fat_stim: ColorRect = $FatStim
@onready var fat_label: Label = $FatStim/FatLabel
var _dialog_timer: float = 0.0
var _fat_blink: float = 0.0
func _ready() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
@ -35,6 +38,7 @@ func _ready() -> void:
Inventory.inventory_changed.connect(_refresh_inventory)
Shop.points_changed.connect(_refresh_points)
GameState.hp_changed.connect(_on_hp)
GameState.status_changed.connect(func(): _on_hp(GameState.hp, GameState.max_hp))
_on_hp(GameState.hp, GameState.max_hp)
_refresh_inventory()
_refresh_points(Shop.dressler_points)
@ -44,6 +48,17 @@ func _process(delta: float) -> void:
_dialog_timer -= delta
if _dialog_timer <= 0.0:
dialog_panel.visible = false
_update_fat_stim(delta)
func _update_fat_stim(delta: float) -> void:
if fat_stim == null:
return
var fat := GameState.is_fat()
fat_stim.visible = fat and GameState.current_scene_id not in ["title_screen", "death_screen", "intro_cutscene", "catscene"]
if fat:
_fat_blink += delta
fat_label.text = Locale.tr_key("dialog_tiramisu")
fat_stim.color = Color(0.05, 0.05, 0.08, 0.35 + 0.25 * abs(sin(_fat_blink * 3.0)))
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("pause_menu"):
@ -51,14 +66,20 @@ func _unhandled_input(event: InputEvent) -> void:
get_viewport().set_input_as_handled()
func toggle_pause() -> void:
if GameState.current_scene_id in ["title_screen", "death_screen", "intro_cutscene"]:
if GameState.current_scene_id in ["title_screen", "death_screen", "intro_cutscene", "catscene"]:
return
pause_panel.visible = not pause_panel.visible
get_tree().paused = pause_panel.visible
_sync_player_focus(not pause_panel.visible)
if pause_panel.visible:
_refresh_texts()
_refresh_inventory()
func _sync_player_focus(focused: bool) -> void:
for node in get_tree().get_nodes_in_group("player"):
if node.has_method("set_gameplay_focused"):
node.set_gameplay_focused(focused)
func show_dialog(text: String, duration: float = 3.5) -> void:
dialog_label.text = text
dialog_panel.visible = true
@ -84,8 +105,8 @@ func _refresh_texts() -> void:
$PausePanel/Margin/VBox/BuyPointButton.text = Locale.tr_key("menu_buy_point")
$PausePanel/Margin/VBox/BuySunglassesButton.text = Locale.tr_key("shop_sunglasses")
$PausePanel/Margin/VBox/BuyTicketButton.text = Locale.tr_key("shop_ticket")
$PausePanel/Margin/VBox/BuyMilkButton.text = Locale.tr_key("shop_milk")
$PausePanel/Margin/VBox/BuyTiramisuButton.text = Locale.tr_key("shop_tiramisu")
$PausePanel/Margin/VBox/BuyMilkButton.text = Locale.tr_key("shop_continue_joke")
$PausePanel/Margin/VBox/BuyTiramisuButton.text = Locale.tr_key("shop_next_level")
$PausePanel/Margin/VBox/SfxLabel.text = Locale.tr_key("menu_sfx")
$PausePanel/Margin/VBox/MusicLabel.text = Locale.tr_key("menu_music")
$PausePanel/Margin/VBox/LangLabel.text = Locale.tr_key("menu_language")
@ -105,7 +126,14 @@ func _refresh_inventory() -> void:
inventory_list.set_item_metadata(inventory_list.item_count - 1, id)
func _on_hp(hp: int, max_hp: int) -> void:
hp_label.text = "HP %d/%d" % [hp, max_hp]
var extra := ""
if GameState.is_fat():
extra += " | " + Locale.tr_key("status_fat", [str(int(GameState.fat_time_left))])
if GameState.is_shocked():
extra += " | " + Locale.tr_key("status_shock")
if GameState.is_glitched_slow():
extra += " | " + Locale.tr_key("status_glitch")
hp_label.text = "HP %d/%d%s" % [hp, max_hp, extra]
func _on_achievement(_id: String, title: String) -> void:
toast_label.text = Locale.tr_key("toast_achievement", [title])
@ -122,6 +150,7 @@ func _on_burger_cham() -> void:
func _on_resume_pressed() -> void:
pause_panel.visible = false
get_tree().paused = false
_sync_player_focus(true)
func _on_buy_point() -> void:
Shop.purchase("buy_point")
@ -133,10 +162,10 @@ func _on_buy_ticket() -> void:
Shop.purchase("death_ticket")
func _on_buy_milk() -> void:
Shop.purchase("milk")
Shop.purchase("continue_joke")
func _on_buy_tiramisu() -> void:
Shop.purchase("tiramisu")
Shop.purchase("next_level")
func _on_sfx_changed(value: float) -> void:
Settings.set_sfx_volume(value)