mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
gofmt: bring internal/ and cmd/ back to gofmt -l clean
Mechanical `gofmt -w ./internal ./cmd`. Mostly struct-field realignment that had drifted, plus a few trailing-newline fixes. No behaviour change — gofmt is semantics-preserving, and build/vet/test are green either side. Split out from the code-review fixes that follow so those stay reviewable instead of hiding inside a wall of realignment.
This commit is contained in:
@@ -3,15 +3,18 @@
|
||||
// outcomes mirror what live players hit.
|
||||
//
|
||||
// Single run:
|
||||
//
|
||||
// expedition-sim [-class fighter] [-level 5] [-zone goblin_warrens]
|
||||
// [-bank 1000] [-cap 50] [-log] [-data DIR]
|
||||
//
|
||||
// Party run (N3/P7 — the leader is -class; followers clone it unless named):
|
||||
//
|
||||
// expedition-sim -party 3 -level 15 -zone dragons_lair
|
||||
// expedition-sim -party 2 -class cleric -party-classes fighter -level 16 ...
|
||||
//
|
||||
// Matrix mode (cartesian sweep over classes × levels × zones × N runs,
|
||||
// one JSON object per stdout line, log suppressed by default):
|
||||
//
|
||||
// expedition-sim -matrix -classes fighter,mage -levels 5,10 \
|
||||
// -zones goblin_warrens,wolf_den -runs 20
|
||||
package main
|
||||
@@ -269,7 +272,6 @@ func matrixWorker(exe string, in <-chan matrixJob, out chan<- *plugin.SimResult,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func runOne(dataDir string, uid id.UserID, class plugin.DnDClass, level int, zone plugin.ZoneID, bank float64, cap, days int, followers []string) (*plugin.SimResult, error) {
|
||||
runner, err := plugin.NewSimRunner(dataDir)
|
||||
if err != nil {
|
||||
|
||||
@@ -1558,4 +1558,3 @@ func (p *AdventurePlugin) handleBoostCmd(ctx MessageContext) error {
|
||||
advSetBoost(true)
|
||||
return p.SendReply(ctx.RoomID, ctx.EventID, "⚡ Double XP/money boost **enabled**! All adventure XP and loot values are doubled.")
|
||||
}
|
||||
|
||||
|
||||
@@ -79,4 +79,3 @@ var blacksmithBrokenCondition = []string{
|
||||
"_looks at the condition, looks at you, looks back at the condition_ You know it costs more when you let it get like this. Of course you know. You just didn't care. That's fine. I care enough for both of us. It'll cost you.",
|
||||
"This could have been avoided with regular visits. _slides the cost estimate across the counter without breaking eye contact_",
|
||||
}
|
||||
|
||||
|
||||
@@ -275,6 +275,7 @@ var PetCatDeflect = []string{
|
||||
"Your cat is already somewhere else.\n\nIt blinks.\n\nNot at you.\n\nAt nothing.\n\n" +
|
||||
"The way cats do.",
|
||||
}
|
||||
|
||||
// Fires randomly in the morning DM. Cat has left something.
|
||||
// Results in a defense boost for the day.
|
||||
// The cat is proud. The cat will never stop doing this.
|
||||
|
||||
@@ -920,7 +920,6 @@ func renderAdvDailySummary(date string, tb *TwinBeeResult, tbRewards TwinBeeRewa
|
||||
sb.WriteString("\n")
|
||||
}
|
||||
|
||||
|
||||
// Standout
|
||||
if bestPlayer != nil && bestPlayer.LootValue > 0 {
|
||||
pool := SummaryStandoutGood
|
||||
|
||||
@@ -877,5 +877,3 @@ func (p *BlackjackPlugin) recordBJScore(userID id.UserID, net float64) {
|
||||
recordBotDefeat(userID, "blackjack")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -592,4 +592,3 @@ func (p *AdventurePlugin) resolveDungeonAction(
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@@ -1298,4 +1298,3 @@ func trySave(st *combatState, player *Combatant, phaseName string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ const (
|
||||
)
|
||||
|
||||
// ArmorProfile is the spec's struct. MaxDEXBonus convention:
|
||||
//
|
||||
// -1 = unlimited (light armor takes full DEX mod)
|
||||
// 2 = medium (cap at +2)
|
||||
// 0 = heavy (no DEX bonus)
|
||||
|
||||
@@ -535,4 +535,3 @@ func nullableString(s string) any {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ func TestSaveHarvestNodes_DropsLegacyRoomKey(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestResolveHarvestOutcome_Brackets(t *testing.T) {
|
||||
cases := []struct {
|
||||
roll, dc int
|
||||
|
||||
@@ -323,6 +323,7 @@ func addSupplyPurchase(s ExpeditionSupplies, p SupplyPurchase) ExpeditionSupplie
|
||||
// - siege overrides everything with a hard 2× floor (even for tier 1
|
||||
// where HarshMod is 1×) — the dungeon is actively starving you out.
|
||||
// - otherwise, harshActive applies HarshMod (zone-tier scaled).
|
||||
//
|
||||
// phase5BDailyBurnRatePct is the shipped daily-burn multiplier from
|
||||
// Phase 3-B's sweep + Phase 5-B's post-buff re-validation. 50 means
|
||||
// "half live burn" — needed because the Phase 5-B player power floor
|
||||
|
||||
@@ -455,6 +455,7 @@ const AbyssInstabilityPerDay = 5
|
||||
const AbyssMaxInstability = 100
|
||||
|
||||
// AbyssInstabilityBandFor classifies the §7.6 instability tiers.
|
||||
//
|
||||
// normal: 0–20
|
||||
// mild: 21–40 (-1 WIS)
|
||||
// warp: 41–60 (rooms shift order)
|
||||
|
||||
@@ -102,6 +102,7 @@ func applyRacePassives(stats *CombatStats, mods *CombatModifiers, c *DnDCharacte
|
||||
// BEFORE consumable application (so consumables can stack on top).
|
||||
//
|
||||
// Some passives ride on existing CombatModifiers fields:
|
||||
//
|
||||
// Rogue's Sneak Attack reuses AutoCritFirst (the consumable Crystal Berry
|
||||
// field) — the engine already implements first-hit-auto-crit semantics.
|
||||
// Cleric's Divine Favor reuses HealItem, the under-50%-HP heal trigger.
|
||||
|
||||
@@ -623,4 +623,3 @@ func addLoot(runID string, itemID string) error {
|
||||
WHERE run_id = ?`, string(lootJSON), runID)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -583,4 +583,3 @@ func (p *EuroPlugin) handleGrant(ctx MessageContext) error {
|
||||
return p.SendReply(ctx.RoomID, ctx.EventID,
|
||||
fmt.Sprintf("✅ Granted €%d to **%s**. New balance: €%d.", int(amount), targetName, int(newBalance)))
|
||||
}
|
||||
|
||||
|
||||
@@ -1281,6 +1281,7 @@ func TestExpeditionBalance_Phase5A_TierWideSensitivity(t *testing.T) {
|
||||
// what flat delta on top of the ladder lands T1-T5 in band.
|
||||
//
|
||||
// Bands (gogobee_expedition_difficulty.md):
|
||||
//
|
||||
// T1 80% (70-90%) T2 72% (62-82%) T3 65% (55-75%)
|
||||
// T4 55% (45-65%) T5 45% (35-55%)
|
||||
//
|
||||
|
||||
@@ -171,8 +171,6 @@ func recordBotDefeat(userID id.UserID, game string) {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// redirectToGamesRoom returns the room ID for games-restricted redirect.
|
||||
func redirectToGamesRoom(sender id.UserID) string {
|
||||
_ = sender
|
||||
|
||||
@@ -973,4 +973,3 @@ func (p *HangmanPlugin) recordHangmanScore(userID id.UserID, earned float64) {
|
||||
string(userID), earned, earned,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ import (
|
||||
// ── formatNumber (xp.go) ───────────────────────────────────────────────────
|
||||
|
||||
func TestFormatNumber_Small(t *testing.T) {
|
||||
cases := []struct{ in int; want string }{
|
||||
cases := []struct {
|
||||
in int
|
||||
want string
|
||||
}{
|
||||
{0, "0"},
|
||||
{1, "1"},
|
||||
{999, "999"},
|
||||
@@ -21,7 +24,10 @@ func TestFormatNumber_Small(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFormatNumber_WithCommas(t *testing.T) {
|
||||
cases := []struct{ in int; want string }{
|
||||
cases := []struct {
|
||||
in int
|
||||
want string
|
||||
}{
|
||||
{1000, "1,000"},
|
||||
{10000, "10,000"},
|
||||
{1000000, "1,000,000"},
|
||||
|
||||
@@ -1249,7 +1249,6 @@ func (p *HoldemPlugin) removePlayer(game *HoldemGame, uid id.UserID) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func (p *HoldemPlugin) getNPCBalance() int64 {
|
||||
d := db.Get()
|
||||
var balance int64
|
||||
|
||||
@@ -381,4 +381,3 @@ func (g *HoldemGame) returnUncalledBet() (name string, amount int64) {
|
||||
|
||||
return "", 0
|
||||
}
|
||||
|
||||
|
||||
@@ -2039,5 +2039,3 @@ func (p *UnoPlugin) recordGame(game *unoGame, result string, potBefore float64)
|
||||
time.Now().UTC().Format("2006-01-02 15:04:05"),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -658,4 +658,3 @@ func parseNoMercyFlags(args string) (noMercy bool, sevenZeroRule bool, amountStr
|
||||
|
||||
return true, false, rest
|
||||
}
|
||||
|
||||
|
||||
@@ -484,8 +484,6 @@ func wordleCategoryHint(category WordleCategory) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
// isValidWord checks if a word is valid, using the in-memory cache first,
|
||||
// then the custom allow-list, then DreamDict.
|
||||
// Returns (valid, apiError). apiError is true when the service is unreachable.
|
||||
@@ -545,7 +543,6 @@ func (p *WordlePlugin) fetchDefinition(answer string) string {
|
||||
return dictFetchDefinitionText(p.dict, answer, lang)
|
||||
}
|
||||
|
||||
|
||||
func (p *WordlePlugin) nextPuzzleNumber() int {
|
||||
d := db.Get()
|
||||
var count int
|
||||
@@ -842,4 +839,3 @@ func (p *WordlePlugin) rehydratePuzzles() {
|
||||
slog.Info("wordle: rehydrated puzzle", "room", roomID, "answer_len", pr.wordLength, "guesses", len(puzzle.Guesses))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,4 +120,3 @@ func TestCurrentRoomType_GraphAuthored(t *testing.T) {
|
||||
t.Errorf("graph mode + secret node: got %s, want %s", got, RoomExploration)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -427,4 +427,3 @@ func resolveForkChoice(pf *pendingFork, choice int) (pendingChoice, error) {
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -240,4 +240,3 @@ func TestNodeKindToRoomType(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user