output support card lb/exp and gold skill counts

Fixes #1.
Fixes #2.
This commit is contained in:
2026-07-29 15:46:58 -04:00
parent f5d102718d
commit aca6da187d
+59 -2
View File
@@ -2,9 +2,9 @@ package main
import (
"iter"
"log/slog"
"reflect"
"strconv"
"strings"
)
type Row struct {
@@ -20,13 +20,26 @@ type Row struct {
Scenario int
Character int
Deck1 int
Deck1LB int
Deck1Exp int
Deck2 int
Deck2LB int
Deck2Exp int
Deck3 int
Deck3LB int
Deck3Exp int
Deck4 int
Deck4LB int
Deck4Exp int
Deck5 int
Deck5LB int
Deck5Exp int
Deck6 int
Deck6LB int
Deck6Exp int
Races int
Wins int
GoldSkills int
NightOwl bool // chara effect id 1
Slacker bool // 2
SkinOutbreak bool // 3
@@ -38,6 +51,7 @@ type Row struct {
HotTopic bool // 9
PracticePerfect bool // 10
VeryGoodAtTraining bool // 11
OtherConds []string
}
var headers []string
@@ -49,6 +63,14 @@ func init() {
}
}
func elem[T any, S ~[]T](s S, i int) T {
if i < 0 || i >= len(s) {
var zero T
return zero
}
return s[i]
}
func ismRows(key string, ism WorkIdleSingleMode) iter.Seq[Row] {
return func(yield func(Row) bool) {
pl := ism.ProgressLog
@@ -60,25 +82,45 @@ func ismRows(key string, ism WorkIdleSingleMode) iter.Seq[Row] {
}
}
var conditions [11]bool
var otherconds []string
for _, v := range pl.CharaEffectLog {
if v.CharaEffectID < 1 || v.CharaEffectID > 11 {
slog.Warn("skipping unknown charaEffectID", slog.Int("id", int(v.CharaEffectID)), slog.Bool("active", v.IsActive))
otherconds = append(otherconds, strconv.Itoa(int(v.CharaEffectID)))
continue
}
conditions[v.CharaEffectID-1] = true
}
var golds int
for _, t := range ism.End.Chara.SkillTips {
if t.Rarity == 2 {
golds++
}
}
row := Row{
File: key,
Scenario: int(ism.ProgressInfo.Chara.ScenarioID),
Character: int(ism.ProgressInfo.Chara.CardID),
Deck1: int(pl.SupportCardGains[0].SupportCardID),
Deck1LB: int(elem(ism.End.Chara.SupportCards, 0).LimitBreakCount),
Deck1Exp: int(elem(ism.End.Chara.SupportCards, 0).Exp),
Deck2: int(pl.SupportCardGains[1].SupportCardID),
Deck2LB: int(elem(ism.End.Chara.SupportCards, 1).LimitBreakCount),
Deck2Exp: int(elem(ism.End.Chara.SupportCards, 1).Exp),
Deck3: int(pl.SupportCardGains[2].SupportCardID),
Deck3LB: int(elem(ism.End.Chara.SupportCards, 2).LimitBreakCount),
Deck3Exp: int(elem(ism.End.Chara.SupportCards, 2).Exp),
Deck4: int(pl.SupportCardGains[3].SupportCardID),
Deck4LB: int(elem(ism.End.Chara.SupportCards, 3).LimitBreakCount),
Deck4Exp: int(elem(ism.End.Chara.SupportCards, 3).Exp),
Deck5: int(pl.SupportCardGains[4].SupportCardID),
Deck5LB: int(elem(ism.End.Chara.SupportCards, 4).LimitBreakCount),
Deck5Exp: int(elem(ism.End.Chara.SupportCards, 4).Exp),
Deck6: int(pl.SupportCardGains[5].SupportCardID),
Deck6LB: int(elem(ism.End.Chara.SupportCards, 5).LimitBreakCount),
Deck6Exp: int(elem(ism.End.Chara.SupportCards, 5).Exp),
Races: races,
Wins: wins,
GoldSkills: golds,
NightOwl: conditions[0],
Slacker: conditions[1],
SkinOutbreak: conditions[2],
@@ -90,6 +132,7 @@ func ismRows(key string, ism WorkIdleSingleMode) iter.Seq[Row] {
HotTopic: conditions[8],
PracticePerfect: conditions[9],
VeryGoodAtTraining: conditions[10],
OtherConds: otherconds,
}
row.GainSource = "Events"
@@ -146,13 +189,26 @@ func (r Row) csv() []string {
strconv.Itoa(r.Scenario),
strconv.Itoa(r.Character),
strconv.Itoa(r.Deck1),
strconv.Itoa(r.Deck1LB),
strconv.Itoa(r.Deck1Exp),
strconv.Itoa(r.Deck2),
strconv.Itoa(r.Deck2LB),
strconv.Itoa(r.Deck2Exp),
strconv.Itoa(r.Deck3),
strconv.Itoa(r.Deck3LB),
strconv.Itoa(r.Deck3Exp),
strconv.Itoa(r.Deck4),
strconv.Itoa(r.Deck4LB),
strconv.Itoa(r.Deck4Exp),
strconv.Itoa(r.Deck5),
strconv.Itoa(r.Deck5LB),
strconv.Itoa(r.Deck5Exp),
strconv.Itoa(r.Deck6),
strconv.Itoa(r.Deck6LB),
strconv.Itoa(r.Deck6Exp),
strconv.Itoa(r.Races),
strconv.Itoa(r.Wins),
strconv.Itoa(r.GoldSkills),
strconv.FormatBool(r.NightOwl),
strconv.FormatBool(r.Slacker),
strconv.FormatBool(r.SkinOutbreak),
@@ -164,5 +220,6 @@ func (r Row) csv() []string {
strconv.FormatBool(r.HotTopic),
strconv.FormatBool(r.PracticePerfect),
strconv.FormatBool(r.VeryGoodAtTraining),
strings.Join(r.OtherConds, ", "),
}
}