Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/boost/estimate_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 18 additions & 0 deletions src/boost/rerun-leaderboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
21 changes: 21 additions & 0 deletions src/boost/rerun_leaderboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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) {
Expand Down
Loading