mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 16:42:41 +00:00
Adv 2.0 L4f-prep: flip DisplayName readers to loadDisplayName
Swap all char.DisplayName / c.DisplayName reader sites in internal/plugin/ to loadDisplayName(userID). Touches 12 files across combat (combat_bridge, dnd_zone_combat, dnd_zone_cmd, dnd_expedition_combat), arena, hospital, events, render, masterwork, robbie, scheduler, and adventure.go. Only intentional char.DisplayName references remaining are in adventure_character.go (scan + save + dual-write) and the player_meta.go doc comment. go vet + go test ./internal/plugin/... clean. Unblocks deferred L2 step 9 (arena AdvCharacter import drop) once L4 hospital/pets/render also lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -205,10 +205,11 @@ type arenaBossNarration struct {
|
||||
// surrounding economic glue. There is no legacy fallback — a boss-flow
|
||||
// error surfaces to the player and aborts the round.
|
||||
func (p *AdventurePlugin) resolveArenaRound(ctx MessageContext, run *ArenaRun, char *AdventureCharacter, equip map[EquipmentSlot]*AdvEquipment, tier *ArenaTier, monster *ArenaMonster) error {
|
||||
displayName, _ := loadDisplayName(ctx.Sender)
|
||||
intro, phases, outcome, result, err := p.resolveArenaBoss(ctx.Sender, ArenaBossEncounter{
|
||||
Tier: run.Tier,
|
||||
Round: run.Round,
|
||||
DisplayName: char.DisplayName,
|
||||
DisplayName: displayName,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("arena: boss flow failed", "user", ctx.Sender, "err", err)
|
||||
@@ -299,7 +300,8 @@ func (p *AdventurePlugin) handleArenaStats(ctx MessageContext) error {
|
||||
} else {
|
||||
slog.Error("player_meta: arena stats read failed, falling back to AdvCharacter", "user", ctx.Sender, "err", err)
|
||||
}
|
||||
return p.SendDM(ctx.Sender, renderArenaPersonalStats(char.DisplayName, wins, losses, stats))
|
||||
displayName, _ := loadDisplayName(ctx.Sender)
|
||||
return p.SendDM(ctx.Sender, renderArenaPersonalStats(displayName, wins, losses, stats))
|
||||
}
|
||||
|
||||
func (p *AdventurePlugin) handleArenaLeaderboard(ctx MessageContext) error {
|
||||
@@ -401,7 +403,8 @@ func (p *AdventurePlugin) resolveArenaSurvival(ctx MessageContext, run *ArenaRun
|
||||
|
||||
if dropped := p.arenaRollHelmetDrop(ctx.Sender, run.Tier); dropped != nil {
|
||||
finalMessage += "\n" + renderArenaHelmetDrop(dropped)
|
||||
p.postArenaDropAnnouncement(char.DisplayName, dropped)
|
||||
displayName, _ := loadDisplayName(ctx.Sender)
|
||||
p.postArenaDropAnnouncement(displayName, dropped)
|
||||
}
|
||||
|
||||
done := p.sendZoneCombatMessages(ctx.Sender, phaseMessages, finalMessage)
|
||||
@@ -498,7 +501,8 @@ func (p *AdventurePlugin) resolveArenaDeath(ctx MessageContext, run *ArenaRun, c
|
||||
if dt.PetRecovered {
|
||||
gr := gamesRoom()
|
||||
if gr != "" {
|
||||
_ = p.SendMessage(gr, petDitchRecoveryGameRoom(char.DisplayName, char.PetName, true))
|
||||
displayName, _ := loadDisplayName(ctx.Sender)
|
||||
_ = p.SendMessage(gr, petDitchRecoveryGameRoom(displayName, char.PetName, true))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,8 +585,9 @@ func (p *AdventurePlugin) arenaCompleteSession(userID id.UserID, run *ArenaRun,
|
||||
// Room announcement for T5
|
||||
gr := gamesRoom()
|
||||
if gr != "" {
|
||||
displayName, _ := loadDisplayName(userID)
|
||||
announce := fmt.Sprintf("🏆 **%s has conquered the Arena.** Tier 5 streak. €%d earned. That Which Has Always Been has fallen.",
|
||||
char.DisplayName, run.Earnings)
|
||||
displayName, run.Earnings)
|
||||
p.SendMessage(id.RoomID(gr), announce)
|
||||
}
|
||||
}
|
||||
@@ -596,9 +601,10 @@ func (p *AdventurePlugin) arenaCompleteSession(userID id.UserID, run *ArenaRun,
|
||||
// Game room announcement
|
||||
gr := gamesRoom()
|
||||
if gr != "" {
|
||||
displayName, _ := loadDisplayName(userID)
|
||||
p.SendMessage(id.RoomID(gr), fmt.Sprintf(
|
||||
"🏆 %s walked out of the arena with the Gladiator's Helm. Tier %d streak. They had the option to stop. They did not stop.",
|
||||
char.DisplayName, tiersWon))
|
||||
displayName, tiersWon))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user