From ef60c96735f9556ac728b50ef11351046a1dea10 Mon Sep 17 00:00:00 2001 From: danny Date: Sun, 5 Jul 2026 17:01:53 +0200 Subject: [PATCH] Phase 4a: Unterrichts-Stationen, FactionSystem, Permadeath-Toggle - training_station.gd: drei Stationen (Kampftraining -> Kraft, Landnavigation -> Schnelligkeit im Reiterquadranten; Geschichte & RSC -> Verstand im Klassenraum), je +2 auf den Stat (an STAT_MAX geklemmt), Rueckmeldung per Sprechblase, Doppel-Eingabe-Schutz - TimeSystem.try_spend_slot(): erster echter Verbraucher von advance_slot() - Vormittag/Nachmittag ruecken vor, der Abend wird als verbraucht markiert und blockiert weitere Aktivitaeten bis zum Schlafsaal; Slot-Freigabe bei Slot-Wechsel/Reset - FactionSystem als Fassade ueber neues gespeichertes GameState.faction_standings (-100..100, Signal faction_standing_changed), Fraktions-ID gezeichnete; Story-Logik folgt in 4b/4c - Permadeath-Toggle im Hauptmenue (fokus-navigierbar, Text synchron); GameState.reset() laesst is_permadeath_enabled bewusst unangetastet (Menue-Option), Save/Load stellt den Zustand wieder her - Debug-Overlay: Gezeichnete-Standing sichtbar, F9/F10 verschieben es testweise (reine Overlay-Debug-Hilfe ohne Input-Action) - Headless verifiziert (29 Checks): Slot-Kette Vormittag->Nachmittag-> Abend->blockiert->Schlafen, Stat-Zuwaechse aller drei Stationen, Faction-Signal + Save/Load-Roundtrip, Toggle inkl. Reset- und Persistenz-Semantik Co-Authored-By: Claude Fable 5 --- scenes/hub/classroom.tscn | 59 ++++++++++++- scenes/hub/rider_quadrant.tscn | 104 ++++++++++++++++++++++- scenes/ui/main_menu.tscn | 5 ++ scripts/autoloads/faction_system.gd | 31 +++++-- scripts/autoloads/game_state.gd | 30 ++++++- scripts/autoloads/time_system.gd | 21 ++++- scripts/gameplay/training_station.gd | 78 +++++++++++++++++ scripts/gameplay/training_station.gd.uid | 1 + scripts/ui/debug_overlay.gd | 10 ++- scripts/ui/main_menu.gd | 16 ++++ 10 files changed, 345 insertions(+), 10 deletions(-) create mode 100644 scripts/gameplay/training_station.gd create mode 100644 scripts/gameplay/training_station.gd.uid diff --git a/scenes/hub/classroom.tscn b/scenes/hub/classroom.tscn index b222418..2f1abc5 100644 --- a/scenes/hub/classroom.tscn +++ b/scenes/hub/classroom.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=26 format=3] +[gd_scene load_steps=31 format=3] [ext_resource type="Script" path="res://scripts/gameplay/hub_room.gd" id="1_room"] [ext_resource type="PackedScene" path="res://scenes/player.tscn" id="2_player"] [ext_resource type="PackedScene" path="res://scenes/ui/debug_overlay.tscn" id="3_debug"] [ext_resource type="Script" path="res://scripts/gameplay/zone_trigger.gd" id="4_zone"] +[ext_resource type="Script" path="res://scripts/gameplay/training_station.gd" id="5_station"] +[ext_resource type="PackedScene" path="res://scenes/ui/speech_bubble.tscn" id="6_bubble"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_sky"] sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) @@ -61,6 +63,19 @@ size = Vector3(2.5, 1, 0.8) material = SubResource("StandardMaterial3D_desk") size = Vector3(2.5, 1, 0.8) +[sub_resource type="BoxShape3D" id="BoxShape3D_station"] +size = Vector3(1.2, 1.2, 1.2) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_history"] +albedo_color = Color(0.75, 0.7, 0.5, 1) + +[sub_resource type="BoxMesh" id="BoxMesh_history"] +material = SubResource("StandardMaterial3D_history") +size = Vector3(1.2, 1.2, 1.2) + +[sub_resource type="SphereShape3D" id="SphereShape3D_interact"] +radius = 2.5 + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_trigger"] transparency = 1 albedo_color = Color(0.3, 0.8, 1, 0.35) @@ -201,6 +216,48 @@ shape = SubResource("BoxShape3D_teacher_desk") [node name="MeshInstance3D" type="MeshInstance3D" parent="Desks/TeacherDesk"] mesh = SubResource("BoxMesh_teacher_desk") +[node name="HistoryStation" type="StaticBody3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, -3.5) +script = ExtResource("5_station") +station_name = "Geschichte & RSC" +stat_name = "intellect" +success_line = "Trockener Stoff. Aber Wissen wiegt nichts im Gepäck." + +[node name="CollisionShape3D" type="CollisionShape3D" parent="HistoryStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +shape = SubResource("BoxShape3D_station") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="HistoryStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +mesh = SubResource("BoxMesh_history") + +[node name="NameLabel" type="Label3D" parent="HistoryStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0) +billboard = 1 +text = "Geschichte & RSC" +font_size = 56 +outline_size = 14 + +[node name="PromptLabel" type="Label3D" parent="HistoryStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) +visible = false +modulate = Color(1, 0.9, 0.5, 1) +billboard = 1 +text = "E / (A) — Üben" +font_size = 40 +outline_size = 12 + +[node name="InteractionArea" type="Area3D" parent="HistoryStation"] +collision_layer = 0 +collision_mask = 2 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="HistoryStation/InteractionArea"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("SphereShape3D_interact") + +[node name="SpeechBubble" parent="HistoryStation" instance=ExtResource("6_bubble")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.6, 0) + [node name="Triggers" type="Node3D" parent="."] [node name="TriggerRiderQuadrant" type="Area3D" parent="Triggers"] diff --git a/scenes/hub/rider_quadrant.tscn b/scenes/hub/rider_quadrant.tscn index ef63c22..76fc459 100644 --- a/scenes/hub/rider_quadrant.tscn +++ b/scenes/hub/rider_quadrant.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=34 format=3] +[gd_scene load_steps=40 format=3] [ext_resource type="Script" path="res://scripts/gameplay/hub_room.gd" id="1_room"] [ext_resource type="PackedScene" path="res://scenes/player.tscn" id="2_player"] @@ -7,6 +7,7 @@ [ext_resource type="Script" path="res://scripts/gameplay/zone_trigger.gd" id="5_zone"] [ext_resource type="PackedScene" path="res://scenes/ui/speech_bubble.tscn" id="6_bubble"] [ext_resource type="Script" path="res://scripts/gameplay/ambient_chatter.gd" id="7_chatter"] +[ext_resource type="Script" path="res://scripts/gameplay/training_station.gd" id="8_station"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_sky"] sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) @@ -93,6 +94,23 @@ height = 1.8 [sub_resource type="SphereShape3D" id="SphereShape3D_interact"] radius = 2.5 +[sub_resource type="BoxShape3D" id="BoxShape3D_station"] +size = Vector3(1.2, 1.2, 1.2) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_combat"] +albedo_color = Color(0.7, 0.32, 0.25, 1) + +[sub_resource type="BoxMesh" id="BoxMesh_combat"] +material = SubResource("StandardMaterial3D_combat") +size = Vector3(1.2, 1.2, 1.2) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_navigation"] +albedo_color = Color(0.3, 0.6, 0.6, 1) + +[sub_resource type="BoxMesh" id="BoxMesh_navigation"] +material = SubResource("StandardMaterial3D_navigation") +size = Vector3(1.2, 1.2, 1.2) + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_trigger"] transparency = 1 albedo_color = Color(0.3, 0.8, 1, 0.35) @@ -445,6 +463,90 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, -10) [node name="AmbientChatter" type="Node" parent="."] script = ExtResource("7_chatter") +[node name="CombatStation" type="StaticBody3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 0, 12) +script = ExtResource("8_station") +station_name = "Kampftraining" +stat_name = "strength" +success_line = "Die Schultern brennen. Gut so." + +[node name="CollisionShape3D" type="CollisionShape3D" parent="CombatStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +shape = SubResource("BoxShape3D_station") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="CombatStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +mesh = SubResource("BoxMesh_combat") + +[node name="NameLabel" type="Label3D" parent="CombatStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0) +billboard = 1 +text = "Kampftraining" +font_size = 56 +outline_size = 14 + +[node name="PromptLabel" type="Label3D" parent="CombatStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) +visible = false +modulate = Color(1, 0.9, 0.5, 1) +billboard = 1 +text = "E / (A) — Üben" +font_size = 40 +outline_size = 12 + +[node name="InteractionArea" type="Area3D" parent="CombatStation"] +collision_layer = 0 +collision_mask = 2 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="CombatStation/InteractionArea"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("SphereShape3D_interact") + +[node name="SpeechBubble" parent="CombatStation" instance=ExtResource("6_bubble")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.6, 0) + +[node name="NavigationStation" type="StaticBody3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16, 0, 10) +script = ExtResource("8_station") +station_name = "Landnavigation" +stat_name = "agility" +success_line = "Karte, Gelände, Wind — es fügt sich zusammen." + +[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +shape = SubResource("BoxShape3D_station") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +mesh = SubResource("BoxMesh_navigation") + +[node name="NameLabel" type="Label3D" parent="NavigationStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0) +billboard = 1 +text = "Landnavigation" +font_size = 56 +outline_size = 14 + +[node name="PromptLabel" type="Label3D" parent="NavigationStation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) +visible = false +modulate = Color(1, 0.9, 0.5, 1) +billboard = 1 +text = "E / (A) — Üben" +font_size = 40 +outline_size = 12 + +[node name="InteractionArea" type="Area3D" parent="NavigationStation"] +collision_layer = 0 +collision_mask = 2 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationStation/InteractionArea"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("SphereShape3D_interact") + +[node name="SpeechBubble" parent="NavigationStation" instance=ExtResource("6_bubble")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.6, 0) + [node name="Player" parent="." instance=ExtResource("2_player")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 8) diff --git a/scenes/ui/main_menu.tscn b/scenes/ui/main_menu.tscn index 2c5d6e4..4ba64a2 100644 --- a/scenes/ui/main_menu.tscn +++ b/scenes/ui/main_menu.tscn @@ -52,6 +52,11 @@ custom_minimum_size = Vector2(260, 48) layout_mode = 2 text = "Fortsetzen" +[node name="PermadeathButton" type="Button" parent="CenterContainer/VBoxContainer"] +custom_minimum_size = Vector2(260, 48) +layout_mode = 2 +text = "Permadeath: AN" + [node name="QuitButton" type="Button" parent="CenterContainer/VBoxContainer"] custom_minimum_size = Vector2(260, 48) layout_mode = 2 diff --git a/scripts/autoloads/faction_system.gd b/scripts/autoloads/faction_system.gd index 6e5b275..f88abc5 100644 --- a/scripts/autoloads/faction_system.gd +++ b/scripts/autoloads/faction_system.gd @@ -1,7 +1,28 @@ extends Node -## Squad-Ansehen und Fraktions-Standing (Autoload, SPEC.md Abschnitte 6 und 8). +## Zugriffs-Fassade für Fraktions-Standings (Autoload, SPEC.md Abschnitte +## 6 und 8). ## -## Verwaltet ab Phase 4 das Ansehen im Squad sowie das Standing bei der -## Fraktion der Gezeichneten, u. a. geprägt durch die Klinge-↔-Herz-Achse -## nach Marens Tod (STORY.md Abschnitt 6). Phase 0: leeres Skelett ohne -## Logik. +## Die Standing-Daten liegen wie Beziehungen und Story-Flags im GameState +## (faction_standings) und werden dort gespeichert und geladen; diese +## Fassade folgt dem RelationshipSystem-Muster. Wertebereich -100..100. +## Änderungen meldet GameState.faction_standing_changed. Fraktions-IDs +## sind snake_case-Strings; die Gezeichneten laufen unter +## MARKED_FACTION_ID. Story-Logik, die das Standing verschiebt, folgt in +## Phase 4b/4c. + +const MARKED_FACTION_ID := "gezeichnete" + + +## Liefert das Standing (-100..100) einer Fraktion, 0 für unbekannte. +func get_standing(faction_id: String) -> int: + return GameState.get_faction_standing(faction_id) + + +## Setzt das Standing absolut (geklemmt auf -100..100). +func set_standing(faction_id: String, value: int) -> void: + GameState.set_faction_standing(faction_id, value) + + +## Verschiebt das Standing relativ um amount (geklemmt auf -100..100). +func adjust_standing(faction_id: String, amount: int) -> void: + GameState.adjust_faction_standing(faction_id, amount) diff --git a/scripts/autoloads/game_state.gd b/scripts/autoloads/game_state.gd index 8f6eff0..48251dd 100644 --- a/scripts/autoloads/game_state.gd +++ b/scripts/autoloads/game_state.gd @@ -11,6 +11,7 @@ extends Node signal blade_heart_tone_changed(new_tone: int) signal relationship_changed(npc_id: String, new_value: int) +signal faction_standing_changed(faction_id: String, new_value: int) const STAT_MIN := 0 const STAT_MAX := 100 @@ -32,10 +33,13 @@ var humanity := 0 var relationships: Dictionary = {} var completed_dialogues: Dictionary = {} var story_flags: Dictionary = {} +var faction_standings: Dictionary = {} var is_permadeath_enabled := true ## Setzt alle Werte auf die Startwerte eines neuen Spiels zurück. +## is_permadeath_enabled bleibt bewusst unangetastet: Der Toggle ist eine +## Menü-Option und soll ein neues Spiel überleben. func reset() -> void: strength = DEFAULT_STRENGTH agility = DEFAULT_AGILITY @@ -45,7 +49,7 @@ func reset() -> void: relationships.clear() completed_dialogues.clear() story_flags.clear() - is_permadeath_enabled = true + faction_standings.clear() blade_heart_tone_changed.emit(blade_heart_tone) @@ -124,6 +128,25 @@ func get_story_flag(flag_name: String, default: Variant = null) -> Variant: return story_flags.get(flag_name, default) +## Liefert das Fraktions-Standing (-100..100), 0 für unbekannte Fraktionen. +func get_faction_standing(faction_id: String) -> int: + return faction_standings.get(faction_id, 0) + + +## Setzt das Fraktions-Standing absolut (geklemmt auf -100..100) und +## meldet Änderungen über faction_standing_changed. +func set_faction_standing(faction_id: String, value: int) -> void: + var new_value := clampi(value, RELATIONSHIP_MIN, RELATIONSHIP_MAX) + if get_faction_standing(faction_id) != new_value: + faction_standings[faction_id] = new_value + faction_standing_changed.emit(faction_id, new_value) + + +## Verschiebt das Fraktions-Standing relativ um amount (mit Klemmung). +func adjust_faction_standing(faction_id: String, amount: int) -> void: + set_faction_standing(faction_id, get_faction_standing(faction_id) + amount) + + ## Serialisiert den kompletten Zustand als Dictionary für das SaveSystem. func to_save_dict() -> Dictionary: return { @@ -135,6 +158,7 @@ func to_save_dict() -> Dictionary: "relationships": relationships.duplicate(), "completed_dialogues": completed_dialogues.duplicate(), "story_flags": story_flags.duplicate(), + "faction_standings": faction_standings.duplicate(), "is_permadeath_enabled": is_permadeath_enabled, } @@ -162,6 +186,10 @@ func apply_save_dict(data: Dictionary) -> void: var saved_flags: Dictionary = data.get("story_flags", {}) for flag_name in saved_flags: story_flags[String(flag_name)] = saved_flags[flag_name] + faction_standings.clear() + var saved_standings: Dictionary = data.get("faction_standings", {}) + for faction_id in saved_standings: + faction_standings[String(faction_id)] = clampi(int(saved_standings[faction_id]), RELATIONSHIP_MIN, RELATIONSHIP_MAX) blade_heart_tone_changed.emit(blade_heart_tone) for npc_id in relationships: relationship_changed.emit(npc_id, relationships[npc_id]) diff --git a/scripts/autoloads/time_system.gd b/scripts/autoloads/time_system.gd index 8e8af48..92251ea 100644 --- a/scripts/autoloads/time_system.gd +++ b/scripts/autoloads/time_system.gd @@ -20,11 +20,28 @@ const SLOT_NAMES := { var current_slot := DaySlot.MORNING var day_count := 1 +var is_current_slot_used := false + + +## Verbraucht den aktuellen Tages-Slot für eine Aktivität (Unterricht +## etc.): Vormittag/Nachmittag rücken direkt auf den nächsten Slot vor, +## der Abend wird als verbraucht markiert — danach ist bis zum Schlafsaal +## keine Aktivität mehr möglich. Liefert false, wenn der Slot schon +## verbraucht ist. +func try_spend_slot() -> bool: + if is_current_slot_used: + return false + if current_slot == DaySlot.EVENING: + is_current_slot_used = true + else: + advance_slot() + return true ## Setzt den Zyklus auf Tag 1, Vormittag zurück (neues Spiel). func reset() -> void: day_count = 1 + is_current_slot_used = false _change_slot(DaySlot.MORNING) @@ -53,8 +70,10 @@ func get_slot_name() -> String: return SLOT_NAMES[current_slot] -## Setzt den Slot und meldet echte Wechsel über slot_changed. +## Setzt den Slot, gibt den Aktivitäts-Verbrauch frei und meldet echte +## Wechsel über slot_changed. func _change_slot(new_slot: DaySlot) -> void: + is_current_slot_used = false if new_slot == current_slot: return current_slot = new_slot diff --git a/scripts/gameplay/training_station.gd b/scripts/gameplay/training_station.gd new file mode 100644 index 0000000..113e48c --- /dev/null +++ b/scripts/gameplay/training_station.gd @@ -0,0 +1,78 @@ +extends StaticBody3D +## Unterrichts-Station als Tagesaktivität (Phase 4a, SPEC.md Abschnitte 6 +## und 7). +## +## Interaktion über die interact-Action in Reichweite (Area3D am Root). +## Eine Aktivität verbraucht den aktuellen Tages-Slot über +## TimeSystem.try_spend_slot() — der erste echte Verbraucher von +## advance_slot(): Vormittag -> Nachmittag -> Abend; nach der +## Abend-Aktivität geht nichts mehr, bis der Schlafsaal den Tag beendet. +## Der Stat-Zuwachs (stat_gain, Standard +2) läuft über +## GameState.increase_stat() und ist dort am STAT_MAX geklemmt. +## Rückmeldung über die Sprechblase der Station — bewusst kein voller +## Dialogbaum, das ist eine Aktivität, kein NPC-Gespräch. Ein kurzer +## Cooldown schützt vor versehentlichen Doppel-Eingaben. + +const STAT_LABELS := { + "strength": "Kraft", + "agility": "Schnelligkeit", + "intellect": "Verstand", +} +const INPUT_COOLDOWN_MS := 800 + +@export var station_name := "Training" +@export var stat_name := "strength" +@export var stat_gain := 2 +@export var success_line := "Das sitzt. Weiter im Plan." +@export var exhausted_line := "Für heute reicht es — der Schlafsaal wartet." + +var _is_player_in_range := false +var _last_use_ms := -INPUT_COOLDOWN_MS + +@onready var _prompt_label: Label3D = $PromptLabel +@onready var _interaction_area: Area3D = $InteractionArea +@onready var _bubble: Node3D = $SpeechBubble + + +## Verbindet die Reichweiten-Signale des Interaktions-Triggers. +func _ready() -> void: + _interaction_area.body_entered.connect(_on_body_entered) + _interaction_area.body_exited.connect(_on_body_exited) + + +## Startet die Aktivität bei interact in Reichweite, außerhalb laufender +## Dialoge und nach Ablauf des Doppel-Eingabe-Schutzes. +func _unhandled_input(event: InputEvent) -> void: + if not _is_player_in_range: + return + if DialogueSystem.is_dialogue_active: + return + if not event.is_action_pressed("interact"): + return + if Time.get_ticks_msec() - _last_use_ms < INPUT_COOLDOWN_MS: + return + _last_use_ms = Time.get_ticks_msec() + _train() + + +## Verbraucht den Tages-Slot und erhöht den Stat; ist der Slot schon +## verbraucht, gibt es nur die Absage-Zeile. +func _train() -> void: + if not TimeSystem.try_spend_slot(): + _bubble.show_line(exhausted_line) + return + GameState.increase_stat(stat_name, stat_gain) + var stat_label: String = STAT_LABELS.get(stat_name, stat_name) + _bubble.show_line("%s (%s +%d)" % [success_line, stat_label, stat_gain]) + + +## Blendet den Prompt ein, sobald der Spieler die Reichweite betritt. +func _on_body_entered(_body: Node3D) -> void: + _is_player_in_range = true + _prompt_label.visible = true + + +## Blendet den Prompt aus, wenn der Spieler die Reichweite verlässt. +func _on_body_exited(_body: Node3D) -> void: + _is_player_in_range = false + _prompt_label.visible = false diff --git a/scripts/gameplay/training_station.gd.uid b/scripts/gameplay/training_station.gd.uid new file mode 100644 index 0000000..c12a77a --- /dev/null +++ b/scripts/gameplay/training_station.gd.uid @@ -0,0 +1 @@ +uid://dkadufpy8ooaj diff --git a/scripts/ui/debug_overlay.gd b/scripts/ui/debug_overlay.gd index 713437a..5d1bdb2 100644 --- a/scripts/ui/debug_overlay.gd +++ b/scripts/ui/debug_overlay.gd @@ -47,8 +47,15 @@ func _on_dialogue_finished(_dialogue_id: String) -> void: ## Merkt sich das zuletzt benutzte Eingabegerät anhand des Event-Typs; -## Stick-Rauschen unterhalb der Deadzone wird ignoriert. +## Stick-Rauschen unterhalb der Deadzone wird ignoriert. F9/F10 +## verschieben testweise das Gezeichneten-Standing (reine Debug-Hilfe des +## Overlays, bewusst ohne Input-Action — fliegt mit dem Overlay raus). func _input(event: InputEvent) -> void: + if event is InputEventKey and event.pressed and not event.echo: + if event.physical_keycode == KEY_F9: + FactionSystem.adjust_standing(FactionSystem.MARKED_FACTION_ID, -5) + elif event.physical_keycode == KEY_F10: + FactionSystem.adjust_standing(FactionSystem.MARKED_FACTION_ID, 5) if event is InputEventKey or event is InputEventMouseButton or event is InputEventMouseMotion: _active_device = "Tastatur/Maus" elif event is InputEventJoypadButton: @@ -76,6 +83,7 @@ func _process(_delta: float) -> void: for npc_id in TRACKED_NPC_IDS: relationship_parts.append("%s %+d" % [npc_id.capitalize(), RelationshipSystem.get_relationship(npc_id)]) lines.append("Beziehungen: %s" % " ".join(relationship_parts)) + lines.append("Gezeichnete-Standing: %+d (F9/F10 zum Testen)" % FactionSystem.get_standing(FactionSystem.MARKED_FACTION_ID)) var npc_states := PackedStringArray() for npc in get_tree().get_nodes_in_group("npc"): if npc.has_method("get_state_name"): diff --git a/scripts/ui/main_menu.gd b/scripts/ui/main_menu.gd index f66820b..8633f1d 100644 --- a/scripts/ui/main_menu.gd +++ b/scripts/ui/main_menu.gd @@ -15,6 +15,7 @@ const CONTINUE_SCENE := "res://scenes/hub/rider_quadrant.tscn" @onready var _start_button: Button = $CenterContainer/VBoxContainer/StartButton @onready var _continue_button: Button = $CenterContainer/VBoxContainer/ContinueButton +@onready var _permadeath_button: Button = $CenterContainer/VBoxContainer/PermadeathButton @onready var _quit_button: Button = $CenterContainer/VBoxContainer/QuitButton @@ -25,7 +26,9 @@ func _ready() -> void: _continue_button.visible = SaveSystem.has_save() _start_button.pressed.connect(_on_start_pressed) _continue_button.pressed.connect(_on_continue_pressed) + _permadeath_button.pressed.connect(_on_permadeath_pressed) _quit_button.pressed.connect(_on_quit_pressed) + _update_permadeath_text() _start_button.grab_focus.call_deferred() @@ -71,6 +74,19 @@ func _on_continue_pressed() -> void: get_tree().change_scene_to_file(CONTINUE_SCENE) +## Schaltet Permadeath um (SPEC Abschnitt 6: Toggle, Default AN). Die +## Wahl übersteht GameState.reset() und wird beim Speichern im Spielstand +## abgelegt; Fortsetzen stellt den gespeicherten Zustand wieder her. +func _on_permadeath_pressed() -> void: + GameState.is_permadeath_enabled = not GameState.is_permadeath_enabled + _update_permadeath_text() + + ## Beendet das Spiel. func _on_quit_pressed() -> void: get_tree().quit() + + +## Hält den Toggle-Text synchron zum GameState. +func _update_permadeath_text() -> void: + _permadeath_button.text = "Permadeath: %s" % ("AN" if GameState.is_permadeath_enabled else "AUS")