mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Adv 2.0 L5 close-out: §7.4 reconciled + retire 3 CombatLevel readers
Reconcile the migration plan with what actually shipped, and clear the three remaining CombatLevel reader sites so the §7 grep gates hold. Plan reconciliation (gogobee_legacy_migration.md §7.4): The original deletion list was wrong on two counts. (1) AdventureCharacter struct survives as the loaded-view shape post-L5h overlay; only the backing table drops at purge. (2) combat_engine.go / combat_bridge.go / combat_stats.go are not legacy — they're the live combat engine the D&D system layers on top of (applyDnDPlayerLayer/EquipmentLayer/etc. mutate CombatStats before SimulateCombat). Verified via grep: 21+ files reference these symbols across arena/dungeon/zone/expedition. §7.4 rewritten to reflect this; no L6 combat-engine migration needed. Reader fixes: - babysitDailyCost reframed for D&D-level scale. Formula 100 + level*100 preserves the curve at every old-CL boundary given the 5:1 compression in dndLevelFromCombatLevel (Level 4 ≈ old CL 20 = €500/day, Level 10 ≈ old CL 50 = €1100/day). Caller switched to dndLevelForUser. - dnd_sheet.go drops the vestigial "Combat (legacy) %d" stat-block line. - D&D onboarding retired. Post-L5g the welcome DM never fires (every legacy player already has a D&D row), so dnd_onboarding.go + dnd_onboarding_test.go are deleted, the 3 production caller invocations (dnd_zone_combat, combat_bridge, dnd_combat::ensureCharForDnDCmd) and the dnd_setup.go stub-creation branch removed. OnboardingSent column kept for a separate cleanup pass. dnd_audit_fixes_test.go ported. go vet ./... && go test ./... clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,34 +116,6 @@ func (p *AdventurePlugin) dndSetupStatus(ctx MessageContext) error {
|
||||
|
||||
// No row yet → fresh setup. Show suggestion + race menu.
|
||||
if c == nil {
|
||||
// Legacy-player welcome: if they're meeting D&D for the first time
|
||||
// via `!setup` (rather than via combat auto-migration), they still
|
||||
// deserve the onboarding DM. We persist a stub draft row so the
|
||||
// OnboardingSent flag carries forward — neither this nor any later
|
||||
// auto-migration will re-send the welcome.
|
||||
advChar, _ := loadAdvCharacter(ctx.Sender)
|
||||
if advChar != nil && advChar.CombatLevel >= dndLegacyMinLevel {
|
||||
now := time.Now().UTC()
|
||||
// Seed the stub's Level with the computed mapping so the welcome DM
|
||||
// reports the right number ("your level X is now Adv 2.0 level Y").
|
||||
// On !setup confirm the level is recomputed from the same formula,
|
||||
// so the value here matches what the player will actually end up with.
|
||||
stub := &DnDCharacter{
|
||||
UserID: ctx.Sender,
|
||||
Level: dndLevelFromCombatLevel(advChar.CombatLevel),
|
||||
ArmorClass: 10,
|
||||
PendingSetup: true,
|
||||
OnboardingSent: false, // maybeSendDnDOnboarding will flip this on success
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
if err := SaveDnDCharacter(stub); err != nil {
|
||||
slog.Error("dnd: setup stub save failed", "user", ctx.Sender, "err", err)
|
||||
} else {
|
||||
p.maybeSendDnDOnboarding(ctx.Sender, advChar, stub)
|
||||
}
|
||||
}
|
||||
|
||||
sug := inferDnDFromArchetypes(ctx.Sender)
|
||||
var b strings.Builder
|
||||
b.WriteString("⚔️ **Adv 2.0 Setup** — let's build your character.\n\n")
|
||||
|
||||
Reference in New Issue
Block a user