- Add secretbox API schemas, handlers, and routes for all/showDetail/pon/multi - Load secretbox server data through the shared serverdata loader - Fix rarity mapping and pool rules for SR/SSR/UR special boxes - Implement thanks festival pool behavior, including UR guarantee and SSR/UR-only rates - Correct animation-related fields such as is_hit and lowest_rarity, and add rare UR promotion animation Signed-off-by: Sean Du <do4suki@gmail.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package secretbox
|
|
|
|
import (
|
|
secretboxapischema "honoka-chan/internal/schema/api/secretbox"
|
|
honokautils "honoka-chan/internal/utils"
|
|
"time"
|
|
)
|
|
|
|
func all() (res any, err error) {
|
|
secretBoxData, err := honokautils.LoadServerData[secretboxapischema.AllData]("secretbox_data.json")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
secretBoxData.UseCache = 0
|
|
secretBoxData.IsUnitMax = false
|
|
secretBoxData.GaugeInfo.MaxGaugePoint = 100
|
|
secretBoxData.GaugeInfo.GaugePoint = 0
|
|
|
|
for i := range secretBoxData.ItemList {
|
|
if secretBoxData.ItemList[i].Amount < 999 {
|
|
secretBoxData.ItemList[i].Amount = 999
|
|
}
|
|
}
|
|
|
|
for i := range secretBoxData.MemberCategoryList {
|
|
for j := range secretBoxData.MemberCategoryList[i].PageList {
|
|
for k := range secretBoxData.MemberCategoryList[i].PageList[j].ButtonList {
|
|
for m := range secretBoxData.MemberCategoryList[i].PageList[j].ButtonList[k].CostList {
|
|
secretBoxData.MemberCategoryList[i].PageList[j].ButtonList[k].CostList[m].Payable = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
res = secretboxapischema.AllResp{
|
|
Result: secretBoxData,
|
|
Status: 200,
|
|
CommandNum: false,
|
|
TimeStamp: time.Now().Unix(),
|
|
}
|
|
|
|
return res, nil
|
|
}
|