Der Dungeon hat jetzt Gegner, und man kann sterben.
- game/action.rs: sieben Schadenstypen, fuenf der zehn Aktionen, Target
- game/condition.rs: Bedingungsgrammatik (Liste = UND, not je Eintrag)
- game/event.rs: zwoelf Events, Trigger als vierte Wirkungsform
- game/combat.rs: Treffer- und Schadensformel mit drei Klemmbereichen
- Game::apply, drain_events (FIFO), Initiative, Rundenablauf aus Ticket 14
- data/: abilities-, creatures- und modifiers-Registry, [balance] feldweise
- ui/: Combat-Screen mit Faehigkeitsmenue und Sperrgrund
Drei Befunde:
- Die Trefferformel war toter Code — jeder Angriff traf. Nur der Compiler
hat es gemeldet ('hit_chance is never used'). Test haelt sie am Leben.
- Die Warteschlange war ein Stack (pop statt pop_front), obwohl Ticket 08
ausdruecklich 'haengt es hinten an' sagt. Jetzt VecDeque.
- Benannte Modifikatoren (core:poisoned) hatten keine Registry — Ticket 01
laesst apply_modifier per ID referenzieren, aber keine der zwoelf
definierte sie. Das ist die dreizehnte.
43 Tests.
64 lines
2.0 KiB
TOML
64 lines
2.0 KiB
TOML
# Gegner. Die Luecke lag seit Ticket 02 offen — `Creature` war der Laufzeittyp,
|
|
# woher seine Werte kommen, hat nie jemand gesagt (Ticket 14).
|
|
#
|
|
# `ai` ist eine GEORDNETE Liste: der erste passende UND verfuegbare Eintrag
|
|
# gewinnt. Ein Eintrag ohne `condition` greift immer und gehoert ans Ende —
|
|
# fehlt er, setzt der Gegner gelegentlich aus.
|
|
|
|
[[creatures]]
|
|
id = "rat"
|
|
name = "Riesenratte"
|
|
symbol = "r"
|
|
color = "yellow"
|
|
tags = ["core:beast"]
|
|
base = { max_health = 14, damage = 3, hit_chance = 0.65, dexterity = 4, critical_chance = 5 }
|
|
abilities = ["core:rat_bite"]
|
|
ai = [ { ability = "core:rat_bite" } ]
|
|
exp_reward = 4
|
|
|
|
[[creatures]]
|
|
id = "skeleton"
|
|
name = "Skelett"
|
|
symbol = "s"
|
|
color = "white"
|
|
tags = ["core:undead"]
|
|
base = { max_health = 26, damage = 6, hit_chance = 0.7, dexterity = 3, critical_chance = 5 }
|
|
abilities = ["core:attack", "core:bone_throw"]
|
|
ai = [
|
|
{ condition = [ { check = "health_below", who = "self", value = 0.35 } ],
|
|
ability = "core:bone_throw" },
|
|
{ ability = "core:attack" },
|
|
]
|
|
exp_reward = 9
|
|
|
|
[[creatures]]
|
|
id = "ghoul"
|
|
name = "Ghul"
|
|
symbol = "G"
|
|
color = "magenta"
|
|
tags = ["core:undead"]
|
|
base = { max_health = 40, damage = 9, hit_chance = 0.72, dexterity = 5, critical_chance = 10 }
|
|
abilities = ["core:ghoul_claw", "core:second_wind"]
|
|
ai = [
|
|
{ condition = [ { check = "health_below", who = "self", value = 0.4 } ],
|
|
ability = "core:second_wind" },
|
|
{ ability = "core:ghoul_claw" },
|
|
]
|
|
exp_reward = 18
|
|
|
|
[[creatures]]
|
|
id = "bone_lord"
|
|
name = "Knochenfürst"
|
|
symbol = "K"
|
|
color = "red"
|
|
tags = ["core:undead", "core:boss"]
|
|
base = { max_health = 90, damage = 14, hit_chance = 0.78, dexterity = 6, critical_chance = 12, critical_factor = 2.0 }
|
|
abilities = ["core:attack", "core:power_strike", "core:second_wind"]
|
|
ai = [
|
|
{ condition = [ { check = "health_below", who = "self", value = 0.3 } ],
|
|
ability = "core:second_wind" },
|
|
{ ability = "core:power_strike" },
|
|
{ ability = "core:attack" },
|
|
]
|
|
exp_reward = 60
|