mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Combat: fix wounded-carry HP display + auto-crit narration
Two bugs reported back-to-back from a Rogue's run: 1. HP display reset between battles. End of fight 1: 101/123 → start of fight 2: 100/100. applyDnDHPScaling was overwriting Stats.MaxHP with the scaled wound value, so the display denominator dropped along with the numerator. Wounded carry-over became invisible. Fix: introduce CombatStats.StartHP. Combat engine reads it as the entry-HP when set; MaxHP stays put. Display now reads "100/123" as intended. 2. Auto-crit fired on a roll of 11 with no narrative tell. Rogue passive AutoCritFirst was triggering correctly, but the renderer used the generic crit pool, so the player saw "🎲 11 vs AC 10 → CRIT" with no indication their *class* caused it. Fix: tag the crit event with Desc="auto_crit" when the passive (not the dice) caused it; new narrativePlayerAutoCrit pool calls out the training/instinct/exploit theme. Test bound for T5 dungeon death rate loosened from 0.02 to 0.01 — the new Sudden Death phase from the previous commit shifted geared-T5 fights slightly toward player wins. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,9 @@ func renderEvent(e CombatEvent, playerName, enemyName string, result CombatResul
|
||||
|
||||
case "crit":
|
||||
if e.Actor == "player" {
|
||||
if e.Desc == "auto_crit" {
|
||||
return pickFrom(narrativePlayerAutoCrit, picker.player, e.Damage)
|
||||
}
|
||||
return pickFrom(narrativePlayerCrit, picker.player, e.Damage)
|
||||
}
|
||||
return pickFrom(narrativeEnemyCrit, picker.enemy, e.Damage)
|
||||
@@ -357,6 +360,19 @@ var narrativePlayerCrit = []string{
|
||||
"💥 **CRIT!** %d damage. You look at your weapon like it just got a promotion.",
|
||||
}
|
||||
|
||||
// narrativePlayerAutoCrit is used when a forced/auto crit fires *not* from a
|
||||
// natural high roll — Rogue's first-strike instinct, a held/paralyzed enemy,
|
||||
// or a consumable like Ancient Artifact Oil. The roll itself is unimpressive;
|
||||
// the *setup* is what made the hit devastating.
|
||||
var narrativePlayerAutoCrit = []string{
|
||||
"💥 **CRIT — opening exploit.** Years of looking for this exact gap pay off. %d damage. The roll didn't matter. You did.",
|
||||
"💥 Your training takes over before you do. The opening was there; instinct found it. %d damage.",
|
||||
"💥 The enemy left exactly the gap your subclass trained you to punish. %d damage. They did not get to protest.",
|
||||
"💥 **First-strike instinct fires.** You don't aim; you *know*. %d damage. The dice were a formality.",
|
||||
"💥 You read the seam between their guard and their breath. Slip in, slip out. %d damage. They notice on the way down.",
|
||||
"💥 The setup was perfect — the *attack* was just paperwork. %d damage.",
|
||||
}
|
||||
|
||||
var narrativeEnemyCrit = []string{
|
||||
"💥 **CRITICAL HIT** from the enemy. %d damage. That one rearranged something.",
|
||||
"💥 The enemy finds a weak point you didn't know you had. %d damage. Now you know.",
|
||||
|
||||
Reference in New Issue
Block a user