update
This commit is contained in:
160
tests/verify.gd
160
tests/verify.gd
@@ -40,6 +40,7 @@ func _ready() -> void:
|
||||
await test_notieren_im_spiel()
|
||||
await test_tagesablauf_anzeige()
|
||||
await test_ablauf_im_hud()
|
||||
await test_probleme_und_momente()
|
||||
await test_systeme()
|
||||
await test_tempo_des_traums()
|
||||
await test_cooldown()
|
||||
@@ -878,6 +879,165 @@ func test_diagnose() -> void:
|
||||
|
||||
|
||||
## Gegen eine Ursache baut man ein System. Passt die Belohnung, hält es besser.
|
||||
## Die zweite Ebene: Probleme hängen nicht an Stunden, sondern an Momenten.
|
||||
## Gewohnheiten laufen ohne dich weiter -- hier musst du dabei sein.
|
||||
func test_probleme_und_momente() -> void:
|
||||
abschnitt("Probleme zeigen sich in Momenten")
|
||||
var id := "mensch_0"
|
||||
Game.active_mission = id
|
||||
Game.situation = {}
|
||||
Game.situation_pause = 0.0
|
||||
Game.probleme_bekannt.clear()
|
||||
Game.problem_stand.clear()
|
||||
Game.ueberwunden.clear()
|
||||
Game.cooldown.clear()
|
||||
ui().schliessen()
|
||||
|
||||
var prob: Array = Game.probleme_von(id)
|
||||
p(prob.size() >= 1 and prob.size() <= 2,
|
||||
"%s trägt %d Problem(e): %s" % [HumanDB.by_id(id)["name"], prob.size(), str(prob)])
|
||||
var alle_bekannt := true
|
||||
for x in prob:
|
||||
if not Probleme.problem_da(str(x)):
|
||||
alle_bekannt = false
|
||||
p(alle_bekannt, "Alle stehen im Katalog")
|
||||
var ohne_situation: Array = []
|
||||
for x in Probleme.LISTE:
|
||||
if Probleme.situationen_von(str(x)).is_empty():
|
||||
ohne_situation.append(str(x))
|
||||
p(ohne_situation.is_empty(), "Jedes Problem zeigt sich in Situationen%s" %
|
||||
("" if ohne_situation.is_empty() else " — außer " + ", ".join(ohne_situation)))
|
||||
var ohne_technik: Array = []
|
||||
for x in Probleme.LISTE:
|
||||
if Probleme.techniken_gegen(str(x)).is_empty():
|
||||
ohne_technik.append(str(x))
|
||||
p(ohne_technik.is_empty(), "Und gegen jedes gibt es Techniken%s" %
|
||||
("" if ohne_technik.is_empty() else " — außer " + ", ".join(ohne_technik)))
|
||||
|
||||
# Sie kommt von allein, aber nicht sofort
|
||||
p(not Game.situation_laeuft(), "Erst läuft kein Moment")
|
||||
Game.situationen_ticken(1.0, false)
|
||||
p(not Game.situation_laeuft(), "Bei einem Schlafenden kommt keiner")
|
||||
Game.situationen_ticken(1.0, true)
|
||||
p(Game.situation_laeuft(), "Bei einem wachen Menschen bricht einer auf")
|
||||
var problem := Game.situation_problem()
|
||||
p(prob.has(problem), "Und gehört zu einem seiner Probleme: %s" % problem)
|
||||
|
||||
# Solange sie läuft, steht der Traum still
|
||||
Game.progress[id] = 10.0
|
||||
Game.traum_voranbringen(6.0)
|
||||
p(is_equal_approx(Game.mission_progress(id), 10.0),
|
||||
"Im Moment kommt der Traum nicht voran (%.1f %%)" % Game.mission_progress(id))
|
||||
|
||||
# Dabeisein zeigt, was dahintersteckt
|
||||
p(not Game.problem_bekannt(id, problem), "Was dahintersteckt, ist noch unbekannt")
|
||||
Game.situation_sehen()
|
||||
p(Game.problem_bekannt(id, problem), "Dabeisein zeigt es: %s" %
|
||||
Probleme.name_von(problem))
|
||||
|
||||
# Eine unpassende Technik greift nicht
|
||||
var passend := ""
|
||||
var unpassend := ""
|
||||
for tid in TechDB.ids():
|
||||
if Probleme.hilft(tid, problem) and passend == "":
|
||||
passend = tid
|
||||
elif not Probleme.hilft(tid, problem) and unpassend == "":
|
||||
unpassend = tid
|
||||
Game.known[passend] = 0
|
||||
Game.known[unpassend] = 0
|
||||
var res_falsch := Game.situation_anwenden(unpassend)
|
||||
p(res_falsch["ok"] and not res_falsch["treffer"],
|
||||
"%s greift bei %s nicht" % [TechDB.by_id(unpassend)["name"],
|
||||
Probleme.name_von(problem)])
|
||||
p(Game.situation_laeuft(), "Der Moment läuft weiter")
|
||||
|
||||
# Die passende beendet ihn
|
||||
var vorher: float = Game.mission_progress(id)
|
||||
var res := Game.situation_anwenden(passend)
|
||||
p(res["treffer"], "%s trägt hindurch" % TechDB.by_id(passend)["name"])
|
||||
p(not Game.situation_laeuft(), "Der Moment ist vorbei")
|
||||
p(Game.mission_progress(id) > vorher, "Und bringt den Traum voran (%.0f → %.0f %%)" %
|
||||
[vorher, Game.mission_progress(id)])
|
||||
p(Game.problem_fortschritt(id, problem) == 1, "Einmal geschafft")
|
||||
|
||||
# Oft genug, und das Problem kommt nicht wieder
|
||||
for i in range(Game.PROBLEM_UEBERWINDEN):
|
||||
Game.situation = {"mensch": id, "key": Probleme.situationen_von(problem)[0],
|
||||
"problem": problem, "rest": Game.SITUATION_DAUER}
|
||||
Game.cooldown.clear()
|
||||
Game.situation_anwenden(passend)
|
||||
p(Game.problem_ueberwunden(id, problem),
|
||||
"Nach %d Malen ist %s überwunden" % [Game.PROBLEM_UEBERWINDEN,
|
||||
Probleme.name_von(problem)])
|
||||
Game.situation = {}
|
||||
Game.situation_pause = 0.0
|
||||
var kommt_wieder := false
|
||||
for i in range(200):
|
||||
Game.situationen_ticken(1.0, true)
|
||||
if Game.situation_laeuft() and Game.situation_problem() == problem:
|
||||
kommt_wieder = true
|
||||
break
|
||||
p(not kommt_wieder, "Dieser Moment kommt nicht wieder")
|
||||
|
||||
# Beide Ebenen stehen nebeneinander im HUD
|
||||
Game.situation = {}
|
||||
ui()._hud_aktualisieren()
|
||||
p(ui()._ablauf.visible and ui()._probleme.visible,
|
||||
"Tagesablauf und Momente stehen beide im HUD")
|
||||
p(ui()._probleme.text.contains(Probleme.name_von(problem)),
|
||||
"Die Momente nennen das Problem: %s" % ui()._probleme.text.replace("\n", " / "))
|
||||
Game.situation = {"mensch": id, "key": Probleme.situationen_von(problem)[0],
|
||||
"problem": problem, "rest": 9.0}
|
||||
ui()._hud_aktualisieren()
|
||||
p(ui()._probleme.text.contains("Jetzt:"), "Der laufende Moment steht oben")
|
||||
|
||||
# Und er kündigt sich am Menschen selbst an, nicht nur im HUD
|
||||
var wer: Bewohner = null
|
||||
for mm in welt().humans:
|
||||
if mm.data["id"] == id:
|
||||
wer = mm
|
||||
p(wer.beschriftung().contains(str(Probleme.SITUATIONEN[Game.situation["key"]]["name"])),
|
||||
"Am Menschen steht, was gerade aufbricht: %s" %
|
||||
wer.beschriftung().replace("\n", " / "))
|
||||
Game.situation = {}
|
||||
p(not wer.beschriftung().contains("»"), "Ohne Moment steht dort nichts davon")
|
||||
# E führt in den Moment, sonst in den Tagesablauf -- die zwei Ebenen
|
||||
# teilen sich eine Taste, ohne sich in die Quere zu kommen
|
||||
var mensch: Bewohner = null
|
||||
for mm in welt().humans:
|
||||
if mm.data["id"] == id:
|
||||
mensch = mm
|
||||
main.player.set_mode(Player.Mode.GEIST)
|
||||
main.player.folgt = null
|
||||
main.player.global_position = mensch.global_position + Vector3(0, 1.5, 1.5)
|
||||
Game.situation = {}
|
||||
main._process(0.05)
|
||||
main._interagieren()
|
||||
p(ui()._kind == "anwenden", "Ohne Moment führt E in den Tagesablauf (%s)" % ui()._kind)
|
||||
ui().schliessen()
|
||||
Game.situation = {"mensch": id, "key": Probleme.situationen_von(problem)[0],
|
||||
"problem": problem, "rest": 12.0}
|
||||
main._process(0.05)
|
||||
main._interagieren()
|
||||
p(ui()._kind == "situation", "Im Moment führt dieselbe Taste dorthin (%s)" % ui()._kind)
|
||||
p(_panel_text().contains(str(Probleme.SITUATIONEN[Game.situation["key"]]["was"])),
|
||||
"Das Panel zeigt, was gerade passiert")
|
||||
ui().schliessen()
|
||||
|
||||
# Die Gewohnheitsebene läuft davon unberührt weiter
|
||||
Game.situation = {}
|
||||
Game.progress[id] = 0.0
|
||||
Game.traum_voranbringen(24.0)
|
||||
p(Game.mission_progress(id) > 0.0,
|
||||
"Ohne Moment liefert der Tagesablauf wieder sein Tempo (%.0f %%)" %
|
||||
Game.mission_progress(id))
|
||||
|
||||
Game.situation = {}
|
||||
Game.ueberwunden.clear()
|
||||
Game.probleme_bekannt.clear()
|
||||
Game.problem_stand.clear()
|
||||
|
||||
|
||||
## Der Ablauf steht auch im HUD, ohne dass man ein Panel öffnen muss.
|
||||
func test_ablauf_im_hud() -> void:
|
||||
abschnitt("Der Ablauf steht im HUD")
|
||||
|
||||
Reference in New Issue
Block a user