From c403ed5fafddf277bf562f0f30ae7caf9b90c72f Mon Sep 17 00:00:00 2001 From: Michael McCarty Date: Fri, 23 Oct 2026 13:11:28 -0700 Subject: [PATCH] parkles: feat(footer): include GG token variants in leg footer --- src/boost/estimate_time.go | 20 ++++++++++++++++++-- src/boost/rerun-leaderboard.go | 18 ++++++++++++++++++ src/boost/rerun_leaderboard_test.go | 21 +++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/boost/estimate_time.go b/src/boost/estimate_time.go index 41e3b7f1..d3353e06 100644 --- a/src/boost/estimate_time.go +++ b/src/boost/estimate_time.go @@ -479,8 +479,24 @@ func GetContractEstimateString(contractID string, includeLeggySet bool, showGG b if isShortContract { boostTokensDisplay = 8.0 } - str += fmt.Sprintf("-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, %s fair share, %.0f%s boost.\n", - teVal, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, fairShareStr, boostTokensDisplay, ei.GetBotEmojiMarkdown("token")) + if ggicon != "" && includeLeggySet { + ggTokens := 6.0 + if isShortContract { + ggTokens = 8.0 + } + str += fmt.Sprintf("-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, %s fair share, %.0f%s boost (%.0f%s for GG).\n", + teVal, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, fairShareStr, boostTokensDisplay, ei.GetBotEmojiMarkdown("token"), ggTokens, ei.GetBotEmojiMarkdown("token")) + } else if ggicon != "" { + ggTokens := 6.0 + if isShortContract { + ggTokens = 8.0 + } + str += fmt.Sprintf("-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, %s fair share, %.0f%s boost.\n", + teVal, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, fairShareStr, ggTokens, ei.GetBotEmojiMarkdown("token")) + } else { + str += fmt.Sprintf("-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, %s fair share, %.0f%s boost.\n", + teVal, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, fairShareStr, boostTokensDisplay, ei.GetBotEmojiMarkdown("token")) + } } if footerAboutCR && c.MaxCoopSize > 1 { diff --git a/src/boost/rerun-leaderboard.go b/src/boost/rerun-leaderboard.go index 0d46111f..70239f9a 100644 --- a/src/boost/rerun-leaderboard.go +++ b/src/boost/rerun-leaderboard.go @@ -481,6 +481,24 @@ func renderLeaderboardRerunSession(session *lbRerunSession) ([]dc.LayoutComponen builder.WriteString("```\n") } + tokenEmoji := ei.GetBotEmojiMarkdown("token") + normModel := normalizeRerunLBModel(session.model) + switch normModel { + case RerunLBModelLeaderboard: + leggyTokens, _ := calcLeggyBoost(DefaultLeggyTE) + fmt.Fprintf(&builder, "-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, 1.0 fair share, %.0f%s boost.\n", + DefaultLeggyTE, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, leggyTokens, tokenEmoji) + case RerunLBModelLeaderboardGG: + fmt.Fprintf(&builder, "-# Leggy set %.0f TE, %.0f IHR & %.0f delivery stone sets, 1.0 fair share, 6%s boost.\n", + DefaultLeggyTE, DefaultLeggyIHRSlots, DefaultLeggyDeliverySlots, tokenEmoji) + case RerunLBModelStandard: + fmt.Fprintf(&builder, "-# Standard scoring %.0f TE, 1.0 fair share, 20/0 deflector.\n", + DefaultLeggyTE) + case RerunLBModelStandardGG: + fmt.Fprintf(&builder, "-# Standard scoring %.0f TE, 1.0 fair share, 20/0 deflector (GG).\n", + DefaultLeggyTE) + } + builder.WriteString("-# Past season scores are fixed on the in-game leaderboard ~3 weeks after the season ends\n") if builder.Len() > 0 { diff --git a/src/boost/rerun_leaderboard_test.go b/src/boost/rerun_leaderboard_test.go index 08140734..3f126af9 100644 --- a/src/boost/rerun_leaderboard_test.go +++ b/src/boost/rerun_leaderboard_test.go @@ -349,6 +349,9 @@ func TestRenderLeaderboardRerunSession(t *testing.T) { if !strings.Contains(out, "TestPlayer 👽") { t.Errorf("expected normalized alien emoji in user header, got: %s", out) } + if !strings.Contains(out, "Leggy set 100 TE, 8 IHR & 10 delivery stone sets, 1.0 fair share, 5") { + t.Errorf("expected leggy set footer in table output, got: %s", out) + } if !strings.Contains(out, "Past season scores are fixed on the in-game leaderboard") { t.Errorf("expected past seasons footnote in table output, got: %s", out) } @@ -386,9 +389,27 @@ func TestRenderLeaderboardRerunSession(t *testing.T) { if !strings.Contains(outMobile, "Potential Leaderboard Rerun") { t.Errorf("expected title in mobile output, got: %s", outMobile) } + if !strings.Contains(outMobile, "Leggy set 100 TE, 8 IHR & 10 delivery stone sets, 1.0 fair share, 5") { + t.Errorf("expected leggy set footer in mobile output, got: %s", outMobile) + } if !strings.Contains(outMobile, "Past season scores are fixed on the in-game leaderboard") { t.Errorf("expected past seasons footnote in mobile output, got: %s", outMobile) } + + // Test Leaderboard GG footer + session.model = RerunLBModelLeaderboardGG + compsGG, _ := renderLeaderboardRerunSession(session) + textBuilder.Reset() + for _, comp := range compsGG { + if td, ok := comp.(dc.TextDisplay); ok { + textBuilder.WriteString(td.Content) + textBuilder.WriteString("\n") + } + } + outGG := textBuilder.String() + if !strings.Contains(outGG, "Leggy set 100 TE, 8 IHR & 10 delivery stone sets, 1.0 fair share, 6") { + t.Errorf("expected GG 6-token footer in output, got: %s", outGG) + } } func TestRenderLeaderboardRerunTableImage(t *testing.T) {