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 <noreply@anthropic.com>
This commit is contained in:
parent
2ee3c3f782
commit
ef60c96735
10 changed files with 345 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue