mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
N3/P6e: a party that fights every room
Only elite and boss doorways seated a roster. Everything else -- exploration
rooms, patrol encounters, harvest interrupts -- resolved through SimulateCombat
against ctx.Sender, and P6d made the walk commands leader-only. So on a 38-room
T5 expedition a party of three fought together twice and the leader soloed the
other ~35, then died alone while two untouched members stood at full HP.
The plan said the N-body core was already there and only the callers passed one
player. It wasn't: SimulateCombat built a one-seat roster internally. But the
resolution primitives already read st.c -- the cursor's Combatant -- because the
turn engine has called them that way since P3. Only the round loop needed
widening.
combat_engine_party.go carries it: simulateParty, simulatePartyRound,
roundInitiative, enemyTargetSeat. Every roster short-circuit collapses for one
seat, copying P3's solo exemptions, so the RNG draw order is unchanged and
SimulateCombat is now simulateParty([]Combatant{p}, ...).Seats[0].
TestCombatCharacterization is byte-identical; TestSimulateCombat_IsTheOneSeatPartyCase
pins the delegation event-for-event across 40 seeds.
zone_combat_party.go carries the callers' half: runZoneCombatRoster fans out the
character-scoped close-out (HP, XP, achievements, subclass, heal items burned,
Misty's repair) per seat, while loot, threat, kill records and death stay with
whoever knows the room. runZoneCombat remains the explicit solo entry point --
the arena calls it, and an arena bout must never drag in a party.
Death is read per seat off HP, never off the fight's terminal status: a timed-out
party can still have lost somebody, and a solo player at 0 HP has already ended
the fight, so PlayerEndHP <= 0 is exactly the old !TimedOut rule.
Preserved deliberately: a solo player can win at 0 HP (a retaliate aura kills the
swinger on the killing blow, and resolvePlayerAttack returns before enemyDown is
consumed) and is not marked dead. A party marks its downed seats dead on a win,
which is what finishPartyWin always did.
Solo T5 re-sweep is unregressed (fighter 47-73%, cleric 20-33%). Party of 3 now
clears 100% of every T5 cell, which is P8's problem: the enemy takes one turn per
round and swings at one seat, so a party of N deals xN damage and each member
takes ~1/N^2 of the solo incoming. An HP scalar cannot close that -- it restores
the fight's duration, not the enemy's action economy.
This commit is contained in:
@@ -1043,13 +1043,18 @@ func (p *AdventurePlugin) resolveCombatRoom(userID id.UserID, run *DungeonRun, z
|
||||
return
|
||||
}
|
||||
preHP, _ := dndHPSnapshot(userID)
|
||||
result, rerr := p.runZoneCombat(userID, monster, int(zone.Tier), nil, run.DMMood)
|
||||
// P6e: the whole party fights the room, not just whoever owns the run.
|
||||
// Seats[0] is the leader — their view drives this narration, which is the
|
||||
// leader's stream. The mood scan reads the whole fight's log.
|
||||
pres, seated, rerr := p.runZoneCombatRoster(
|
||||
zoneCombatRoster(userID), monster, int(zone.Tier), nil, run.DMMood)
|
||||
if rerr != nil {
|
||||
err = rerr
|
||||
return
|
||||
}
|
||||
result := pres.Seats[0]
|
||||
postHP, maxHP := dndHPSnapshot(userID)
|
||||
nat20s, nat1s := scanMoodEventsFromCombat(run.RunID, result)
|
||||
nat20s, nat1s := scanMoodEventsFromEvents(run.RunID, pres.Events)
|
||||
|
||||
// Compact mode: skip TwinBee banter, skip the multi-beat play-by-play.
|
||||
// Render a single outcome line. Still records kills, threat, and drops.
|
||||
@@ -1068,12 +1073,19 @@ func (p *AdventurePlugin) resolveCombatRoom(userID id.UserID, run *DungeonRun, z
|
||||
ob.WriteString(fmt.Sprintf(" (−%d)", hpDelta))
|
||||
}
|
||||
ob.WriteString(".")
|
||||
// Run-scoped once, for the owner: the kill record and the threat one kill
|
||||
// costs. Character-scoped effects fan out per seat.
|
||||
recordZoneKillForUser(userID, monster.ID)
|
||||
applyRoomCombatThreatForUser(userID, elite || isBoss)
|
||||
if drop := p.dropZoneLoot(userID, zone.ID, monster, isBoss, elite); drop != "" {
|
||||
drop, downed := p.closeOutZoneWin(pres, seated, zone, monster, isBoss, elite, "zone")
|
||||
if drop != "" {
|
||||
ob.WriteString(" ")
|
||||
ob.WriteString(drop)
|
||||
}
|
||||
if line := partyCasualtyLine(downed); line != "" {
|
||||
ob.WriteString("\n")
|
||||
ob.WriteString(line)
|
||||
}
|
||||
outcome = ob.String()
|
||||
return
|
||||
}
|
||||
@@ -1138,11 +1150,12 @@ func (p *AdventurePlugin) resolveCombatRoom(userID id.UserID, run *DungeonRun, z
|
||||
// dnd_expedition_combat.go.
|
||||
_, _ = applyMoodEvent(run.RunID, MoodEventPlayerDeath)
|
||||
_ = abandonZoneRun(userID)
|
||||
// Timeout loss = retreat; player took wounds but isn't actually
|
||||
// dead. Don't fire markAdventureDead — that would trigger the 6h
|
||||
// respawn timer for what is mechanically "ran out the clock".
|
||||
// Timeout loss = retreat; the fighters took wounds but nobody actually
|
||||
// died. Don't fire markAdventureDead — that would trigger the 6h respawn
|
||||
// timer for what is mechanically "ran out the clock". Death is read per
|
||||
// seat off HP, which for a solo walker is the same `!TimedOut` rule.
|
||||
closeOutZoneLoss(pres, seated, zone, "zone")
|
||||
if !result.TimedOut {
|
||||
markAdventureDead(userID, "zone", zone.Display)
|
||||
forceExtractExpeditionForRunLoss(userID, "combat death")
|
||||
} else {
|
||||
forceExtractExpeditionForRunLoss(userID, "combat retreat")
|
||||
@@ -1175,10 +1188,15 @@ func (p *AdventurePlugin) resolveCombatRoom(userID id.UserID, run *DungeonRun, z
|
||||
}
|
||||
recordZoneKillForUser(userID, monster.ID)
|
||||
applyRoomCombatThreatForUser(userID, elite)
|
||||
if drop := p.dropZoneLoot(userID, zone.ID, monster, false, elite); drop != "" {
|
||||
drop, downed := p.closeOutZoneWin(pres, seated, zone, monster, false, elite, "zone")
|
||||
if drop != "" {
|
||||
ob.WriteString("\n")
|
||||
ob.WriteString(drop)
|
||||
}
|
||||
if line := partyCasualtyLine(downed); line != "" {
|
||||
ob.WriteString("\n")
|
||||
ob.WriteString(line)
|
||||
}
|
||||
outcome = ob.String()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user