mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Implement memoir sub-status system with level-based unlocks
This commit is contained in:
@@ -114,12 +114,15 @@ func init() {
|
||||
s, _ := utils.EncodeJSONMaps(SortedCostumeLotteryEffectPendingRecords(user)...)
|
||||
return s
|
||||
})
|
||||
register("IUserPartsStatusSub", func(user store.UserState) string {
|
||||
s, _ := utils.EncodeJSONMaps(sortedPartsStatusSubRecords(user)...)
|
||||
return s
|
||||
})
|
||||
registerStatic(
|
||||
"IUserCostumeLevelBonusReleaseStatus",
|
||||
"IUserCostumeLotteryEffectAbility",
|
||||
"IUserCostumeLotteryEffectStatusUp",
|
||||
"IUserPartsPresetTag",
|
||||
"IUserPartsStatusSub",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -493,6 +496,35 @@ func sortedPartsPresetRecords(user store.UserState) []map[string]any {
|
||||
return records
|
||||
}
|
||||
|
||||
func sortedPartsStatusSubRecords(user store.UserState) []map[string]any {
|
||||
keys := make([]store.PartsStatusSubKey, 0, len(user.PartsStatusSubs))
|
||||
for k := range user.PartsStatusSubs {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Slice(keys, func(i, j int) bool {
|
||||
if keys[i].UserPartsUuid != keys[j].UserPartsUuid {
|
||||
return keys[i].UserPartsUuid < keys[j].UserPartsUuid
|
||||
}
|
||||
return keys[i].StatusIndex < keys[j].StatusIndex
|
||||
})
|
||||
records := make([]map[string]any, 0, len(keys))
|
||||
for _, k := range keys {
|
||||
row := user.PartsStatusSubs[k]
|
||||
records = append(records, map[string]any{
|
||||
"userId": user.UserId,
|
||||
"userPartsUuid": row.UserPartsUuid,
|
||||
"statusIndex": row.StatusIndex,
|
||||
"partsStatusSubLotteryId": row.PartsStatusSubLotteryId,
|
||||
"level": row.Level,
|
||||
"statusKindType": row.StatusKindType,
|
||||
"statusCalculationType": row.StatusCalculationType,
|
||||
"statusChangeValue": row.StatusChangeValue,
|
||||
"latestVersion": row.LatestVersion,
|
||||
})
|
||||
}
|
||||
return records
|
||||
}
|
||||
|
||||
func sortedCostumeActiveSkillRecords(user store.UserState) []map[string]any {
|
||||
keys := sortedStringKeys(user.CostumeActiveSkills)
|
||||
records := make([]map[string]any, 0, len(keys))
|
||||
|
||||
Reference in New Issue
Block a user