Phase 5: Dreschen, Bindungs-RNG, Signet-Reveal, Wahrheit 3, Journal, Epilog
- Nachtrag 4c: jack_outcome-Story-Flag (success/failed, Default never_encountered) in beiden Ambush-Ausgaengen - data/dragons/dragons.json: Farben je 19, Schwarz 5; Schwaenze je 24, Federschwanz 4. data/signets/signets.json: zehn kanon-neutrale Signets - DragonBondSystem: Ablehnung Basis 20% (-Herz-Ton/20 max -5, -(Wren+Maren)/4 max -5, -/+5 je Jack-Ausgang, geklemmt 5-35); Federschwanz-Gewicht 4 + Herz-Ton/10 (max +10) + (Wren+Maren)/4 (max +5) +1 bei Jack-Erfolg (Herz-Pfad hebt ~4% auf ~17%); Vater-verbundener Drache als erzaehlerische Faerbung; fixe Zieh-Reihenfolge fuer seedbare Tests. SignetSystem lost aus der Tabelle - Dreschen-Szene (scenes/hatching): atmosphaerisches Set-Piece mit Kamera-Pan, Drachenkreis-Silhouetten, Bindungs-Sequenz ueber Sprechblasen; Wahrheit 3 als Moment der Bindung (Wiedererkennen statt Zufall, truth_3_revealed); Ablehnung bei Permadeath AN toedlich, bei AUS weitere Versuche (nach 3 erzwingt der Story-Modus die Bindung); Ergebnis in GameState.bound_dragon (gespeichert) + Auto-Save - Journal-Grundgeruest an der journal-Action (J/Y-Dreieck), Instanz im Player: zeigt Drache + Signet bzw. Platzhalter, fokus-navigierbar - Epilog (scenes/epilogue): Flug-Teaser als Platzhalter-Tableau - stiller Schwur, Wren winkt von unten, Rauch-Andeutung hinter der Grenze (Haken, nicht ausgespielt), Abspann-Bildschirm zurueck ins Hauptmenue = Ende v1 - Gauntlet-Endtrigger fuehrt jetzt ins Dreschen - Headless verifiziert (34 Checks): Jack-Flag, beide Formel-Profile, kompletter Bindungs-Durchlauf mit Journal und Save-Roundtrip, Epilog bis Hauptmenue, geseedete Ablehnung mit Game Over bei Permadeath AN Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
84a437825b
commit
d7f510eaf9
18 changed files with 852 additions and 14 deletions
|
|
@ -1,10 +1,121 @@
|
|||
extends Node
|
||||
## Drachen-Bindung beim Dreschen (Autoload, SPEC.md Abschnitte 6 und 8).
|
||||
## Drachen-Bindung beim Dreschen (Autoload, SPEC.md Abschnitte 6 und 8,
|
||||
## STORY.md Abschnitt 5 Klimax).
|
||||
##
|
||||
## Würfelt ab Phase 5 die Drachenart über eine gewichtete Zufalls-Tabelle aus
|
||||
## data/dragons (Farbe + Schwanztyp, selten Schwarz ~5 % und Federschwanz
|
||||
## ~4 %). Der Bindungs-Erfolg kombiniert Basis-Zufall mit einem leichten
|
||||
## Kompatibilitäts-Daumen aus Klinge/Herz, Spielweise und Story-Flags
|
||||
## (Wren-/Maren-Bindung, STORY.md Abschnitt 5, Klimax). Drachen können
|
||||
## ablehnen; bei Permadeath AN kann Scheitern tödlich sein. Phase 0: leeres
|
||||
## Skelett ohne Logik.
|
||||
## Basis-Zufall aus data/dragons/dragons.json (Farben: je 19, Schwarz 5;
|
||||
## Schwänze: je 24, Federschwanz 4) plus LEICHTER Kompatibilitäts-Daumen:
|
||||
## - Ablehnungs-Chance: Basis 20 %, minus Herz-Ton/20 (max −5, nur
|
||||
## positiver Ton), minus (Wren+Maren-Beziehung)/4 (max −5), −5 bei
|
||||
## jack_outcome "success" bzw. +5 bei "failed"; geklemmt auf 5–35 %.
|
||||
## - Federschwanz-Gewicht: Basis 4, plus Herz-Ton/10 (max +10, nur
|
||||
## positiver Ton), plus (Wren+Maren)/4 (max +5), +1 bei jack "success" —
|
||||
## gegen die übrigen Schwanz-Gewichte von je 24 (Herz-Pfad mit hoher
|
||||
## Bindung hebt die Chance von ~4 % auf ~17 %; der Daumen auf der
|
||||
## Waage aus STORY.md, kein garantierter Ausgang).
|
||||
## - Vater-verbundener Drache (erzählerische Färbung, STORY.md Klimax):
|
||||
## Chance = Herz-Ton/10 (max 10) + (Wren+Maren)/6 (max 5) Prozent,
|
||||
## nur wenn kein Federschwanz gezogen wurde.
|
||||
## Die Zieh-Reihenfolge in roll_bond ist fix (Ablehnung, Farbe, Schwanz,
|
||||
## Vater-Bindung), damit Tests den Zufall seeden können. Konsequenz einer
|
||||
## Ablehnung (Permadeath) liegt bei der Dreschen-Szene, nicht hier.
|
||||
|
||||
const DRAGONS_PATH := "res://data/dragons/dragons.json"
|
||||
const REJECTION_BASE := 20
|
||||
const REJECTION_MIN := 5
|
||||
const REJECTION_MAX := 35
|
||||
const FEATHER_BASE := 4
|
||||
|
||||
var _colors: Array = []
|
||||
var _tails: Array = []
|
||||
|
||||
|
||||
## Lädt die Drachen-Tabelle beim Start.
|
||||
func _ready() -> void:
|
||||
var file := FileAccess.open(DRAGONS_PATH, FileAccess.READ)
|
||||
if file == null:
|
||||
push_error("Drachen-Tabelle nicht lesbar: %s" % DRAGONS_PATH)
|
||||
return
|
||||
var parsed: Variant = JSON.parse_string(file.get_as_text())
|
||||
file.close()
|
||||
if not (parsed is Dictionary) or not (parsed.get("colors") is Array) or not (parsed.get("tails") is Array):
|
||||
push_error("Drachen-Tabelle ist ungültig: %s" % DRAGONS_PATH)
|
||||
return
|
||||
_colors = parsed["colors"]
|
||||
_tails = parsed["tails"]
|
||||
|
||||
|
||||
## Berechnet die aktuelle Ablehnungs-Chance in Prozent (dokumentierte
|
||||
## Formel, siehe Klassen-Doku).
|
||||
func compute_rejection_chance() -> int:
|
||||
var chance := REJECTION_BASE
|
||||
chance -= clampi(maxi(GameState.blade_heart_tone, 0) / 20, 0, 5)
|
||||
chance -= clampi(_bond_sum() / 4, 0, 5)
|
||||
match str(GameState.get_story_flag("jack_outcome", "never_encountered")):
|
||||
"success":
|
||||
chance -= 5
|
||||
"failed":
|
||||
chance += 5
|
||||
return clampi(chance, REJECTION_MIN, REJECTION_MAX)
|
||||
|
||||
|
||||
## Berechnet das aktuelle Federschwanz-Gewicht (dokumentierte Formel,
|
||||
## siehe Klassen-Doku).
|
||||
func compute_feather_weight() -> int:
|
||||
var weight := FEATHER_BASE
|
||||
weight += clampi(maxi(GameState.blade_heart_tone, 0) / 10, 0, 10)
|
||||
weight += clampi(_bond_sum() / 4, 0, 5)
|
||||
if str(GameState.get_story_flag("jack_outcome", "never_encountered")) == "success":
|
||||
weight += 1
|
||||
return weight
|
||||
|
||||
|
||||
## Berechnet die Chance in Prozent, dass der gebundene Drache mit Tyrveils
|
||||
## Vater verbunden war (nur erzählerische Färbung).
|
||||
func compute_father_chance() -> int:
|
||||
var chance := clampi(maxi(GameState.blade_heart_tone, 0) / 10, 0, 10)
|
||||
chance += clampi(_bond_sum() / 6, 0, 5)
|
||||
return chance
|
||||
|
||||
|
||||
## Würfelt eine Bindung: Ablehnung, dann Farbe, Schwanz und Vater-Bindung.
|
||||
## force_accept überspringt die Ablehnung (Story-Modus lässt nach
|
||||
## mehreren Fehlversuchen niemanden ungebunden zurück).
|
||||
func roll_bond(force_accept := false) -> Dictionary:
|
||||
if not force_accept and randf() * 100.0 < compute_rejection_chance():
|
||||
return { "accepted": false }
|
||||
var color: Dictionary = _pick_weighted(_colors, "", 0)
|
||||
var tail: Dictionary = _pick_weighted(_tails, "feder", compute_feather_weight())
|
||||
var is_feathertail := str(tail.get("id")) == "feder"
|
||||
var is_father_connected := not is_feathertail and randf() * 100.0 < compute_father_chance()
|
||||
return {
|
||||
"accepted": true,
|
||||
"color_id": str(color.get("id")),
|
||||
"color_name": str(color.get("name")),
|
||||
"tail_id": str(tail.get("id")),
|
||||
"tail_name": str(tail.get("name")),
|
||||
"is_black": str(color.get("id")) == "schwarz",
|
||||
"is_feathertail": is_feathertail,
|
||||
"is_father_connected": is_father_connected,
|
||||
}
|
||||
|
||||
|
||||
## Summe der Wren- und Maren-Beziehungswerte (nur positive Anteile).
|
||||
func _bond_sum() -> int:
|
||||
return maxi(RelationshipSystem.get_relationship("wren"), 0) + maxi(RelationshipSystem.get_relationship("maren"), 0)
|
||||
|
||||
|
||||
## Gewichtete Zufallswahl aus einer Tabellen-Liste; override_id ersetzt
|
||||
## das Gewicht eines Eintrags (für den Federschwanz-Daumen).
|
||||
func _pick_weighted(entries: Array, override_id: String, override_weight: int) -> Dictionary:
|
||||
var total := 0
|
||||
for entry in entries:
|
||||
var weight := override_weight if str(entry.get("id")) == override_id else int(entry.get("weight", 0))
|
||||
total += weight
|
||||
var roll := randf() * float(total)
|
||||
var cursor := 0.0
|
||||
for entry in entries:
|
||||
var weight := override_weight if str(entry.get("id")) == override_id else int(entry.get("weight", 0))
|
||||
cursor += float(weight)
|
||||
if roll < cursor:
|
||||
return entry
|
||||
return entries.back()
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var relationships: Dictionary = {}
|
|||
var completed_dialogues: Dictionary = {}
|
||||
var story_flags: Dictionary = {}
|
||||
var faction_standings: Dictionary = {}
|
||||
var bound_dragon: Dictionary = {}
|
||||
var is_permadeath_enabled := true
|
||||
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ func reset() -> void:
|
|||
completed_dialogues.clear()
|
||||
story_flags.clear()
|
||||
faction_standings.clear()
|
||||
bound_dragon.clear()
|
||||
blade_heart_tone_changed.emit(blade_heart_tone)
|
||||
|
||||
|
||||
|
|
@ -147,6 +149,17 @@ func adjust_faction_standing(faction_id: String, amount: int) -> void:
|
|||
set_faction_standing(faction_id, get_faction_standing(faction_id) + amount)
|
||||
|
||||
|
||||
## Speichert das Dreschen-Ergebnis (Farbe, Schwanztyp, Besonderheiten,
|
||||
## Signet) — gleiches Save-Muster wie story_flags.
|
||||
func set_bound_dragon(dragon: Dictionary) -> void:
|
||||
bound_dragon = dragon.duplicate()
|
||||
|
||||
|
||||
## Gibt zurück, ob Tyrveil bereits gebunden ist.
|
||||
func has_bound_dragon() -> bool:
|
||||
return not bound_dragon.is_empty()
|
||||
|
||||
|
||||
## Serialisiert den kompletten Zustand als Dictionary für das SaveSystem.
|
||||
func to_save_dict() -> Dictionary:
|
||||
return {
|
||||
|
|
@ -159,6 +172,7 @@ func to_save_dict() -> Dictionary:
|
|||
"completed_dialogues": completed_dialogues.duplicate(),
|
||||
"story_flags": story_flags.duplicate(),
|
||||
"faction_standings": faction_standings.duplicate(),
|
||||
"bound_dragon": bound_dragon.duplicate(),
|
||||
"is_permadeath_enabled": is_permadeath_enabled,
|
||||
"time_day": TimeSystem.day_count,
|
||||
"time_slot": TimeSystem.current_slot,
|
||||
|
|
@ -193,6 +207,10 @@ func apply_save_dict(data: Dictionary) -> void:
|
|||
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)
|
||||
bound_dragon = {}
|
||||
var saved_dragon: Variant = data.get("bound_dragon", {})
|
||||
if saved_dragon is Dictionary:
|
||||
bound_dragon = saved_dragon.duplicate()
|
||||
TimeSystem.apply_save_state(int(data.get("time_day", 1)), int(data.get("time_slot", 0)), bool(data.get("time_slot_used", false)))
|
||||
blade_heart_tone_changed.emit(blade_heart_tone)
|
||||
for npc_id in relationships:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,38 @@
|
|||
extends Node
|
||||
## Signet-Vergabe nach der Bindung (Autoload, SPEC.md Abschnitte 6 und 8).
|
||||
##
|
||||
## Vergibt ab Phase 5 nach erfolgreicher Drachen-Bindung eine zufällige
|
||||
## einzigartige Kraft aus der Signet-Tabelle in data/signets und rahmt den
|
||||
## Reveal-Moment. Phase 0: leeres Skelett ohne Logik.
|
||||
## Lädt die Signet-Tabelle aus data/signets/signets.json und lost nach
|
||||
## erfolgreicher Bindung eine zufällige einzigartige Kraft aus — der
|
||||
## Reveal-Moment gehört der Dreschen-Szene, die Speicherung dem GameState
|
||||
## (bound_dragon).
|
||||
|
||||
const SIGNETS_PATH := "res://data/signets/signets.json"
|
||||
|
||||
var _signets: Array = []
|
||||
|
||||
|
||||
## Lädt die Signet-Tabelle beim Start.
|
||||
func _ready() -> void:
|
||||
var file := FileAccess.open(SIGNETS_PATH, FileAccess.READ)
|
||||
if file == null:
|
||||
push_error("Signet-Tabelle nicht lesbar: %s" % SIGNETS_PATH)
|
||||
return
|
||||
var parsed: Variant = JSON.parse_string(file.get_as_text())
|
||||
file.close()
|
||||
if not (parsed is Dictionary) or not (parsed.get("signets") is Array):
|
||||
push_error("Signet-Tabelle ist ungültig: %s" % SIGNETS_PATH)
|
||||
return
|
||||
_signets = parsed["signets"]
|
||||
|
||||
|
||||
## Lost ein zufälliges Signet aus (Dictionary mit id, name, description).
|
||||
func roll_signet() -> Dictionary:
|
||||
if _signets.is_empty():
|
||||
push_error("Keine Signets geladen — Fallback-Signet.")
|
||||
return { "id": "windruf", "name": "Windruf", "description": "Ruft für Herzschläge einen tragenden Aufwind." }
|
||||
return _signets.pick_random()
|
||||
|
||||
|
||||
## Anzahl der geladenen Signets (für Tests und Debug).
|
||||
func get_signet_count() -> int:
|
||||
return _signets.size()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ extends Node
|
|||
signal gauntlet_beat_changed(new_beat: String)
|
||||
|
||||
const FLAG_GAUNTLET_BEAT := "gauntlet_beat"
|
||||
const FLAG_TRUTH_3 := "truth_3_revealed"
|
||||
const GAUNTLET_BEATS: Array[String] = [
|
||||
"none",
|
||||
"gauntlet_started",
|
||||
|
|
@ -37,6 +38,18 @@ func has_reached_beat(beat: String) -> bool:
|
|||
return GAUNTLET_BEATS.find(get_gauntlet_beat()) >= GAUNTLET_BEATS.find(beat)
|
||||
|
||||
|
||||
## Setzt das Wahrheit-3-Flag: Die Drachen wählen Gezeichnete bewusst —
|
||||
## Wiedererkennen statt Zufall (STORY.md Abschnitt 3, erfahrbar beim
|
||||
## Dreschen).
|
||||
func reveal_truth_3() -> void:
|
||||
GameState.set_story_flag(FLAG_TRUTH_3, true)
|
||||
|
||||
|
||||
## Gibt zurück, ob Wahrheit 3 bereits enthüllt wurde.
|
||||
func has_truth_3() -> bool:
|
||||
return bool(GameState.get_story_flag(FLAG_TRUTH_3, false))
|
||||
|
||||
|
||||
## Rückt auf einen späteren Beat der Kette vor; Rückwärts-Sprünge und
|
||||
## unbekannte Beats werden ignoriert (mit Warnung).
|
||||
func advance_gauntlet_beat(new_beat: String) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue