From 6d8948cdf122bb379f937fdbbc3db714a6e10398 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 29 Dec 2024 01:42:00 -0500 Subject: [PATCH] [+] Implement infinite penguins --- docs/dev/chusan_dev_notes.md | 28 ++++++++++--------- src/main/java/ext/Ext.kt | 1 - .../samnyan/aqua/sega/chusan/ChusanApis.kt | 16 ++++++++++- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/docs/dev/chusan_dev_notes.md b/docs/dev/chusan_dev_notes.md index 7fdfd978..2e44342e 100644 --- a/docs/dev/chusan_dev_notes.md +++ b/docs/dev/chusan_dev_notes.md @@ -1,19 +1,21 @@ # Chusan dev notes ## Item types -| ItemKind | Name | Single / Multiple | Notes | -|----------|-------------------|-------------------|-------------------------------| -| 1 | Nameplate | Single | - | -| 2 | Frame | Single | - | -| 3 | Trophy | Single | - | -| 4 | Skill | Multiple | Stock is level of skill | -| 5 | Ticket | Multiple | - | -| 6 | Present | Multiple? | - | -| 7 | Music (Unlock) | Single | - | -| 8 | Map Icon | Single | - | -| 9 | System Voice | Single | - | -| 10 | Symbol Chat | Single | - | -| 11 | Avatar Accessory | Single |Part can determined by category| +| ItemKind | Name | Single / Multiple | Notes | +|----------|------------------|-------------------|---------------------------------| +| 1 | Nameplate | Single | - | +| 2 | Frame | Single | - | +| 3 | Trophy | Single | - | +| 4 | Skill | Multiple | Stock is level of skill | +| 5 | Ticket | Multiple | - | +| 6 | Present | Multiple? | - | +| 7 | Music (Unlock) | Single | - | +| 8 | Map Icon | Single | - | +| 9 | System Voice | Single | - | +| 10 | Symbol Chat | Single | - | +| 11 | Avatar Accessory | Single | Part can determined by category | + +Note: Chuni penguin statues are tickets (ok that sounds dumb) ## Avatar accessory category | Category ID | Part name | diff --git a/src/main/java/ext/Ext.kt b/src/main/java/ext/Ext.kt index 8374216b..9671ac8b 100644 --- a/src/main/java/ext/Ext.kt +++ b/src/main/java/ext/Ext.kt @@ -21,7 +21,6 @@ import java.security.MessageDigest import java.time.LocalDate import java.time.LocalDateTime import java.time.ZoneId -import java.time.ZonedDateTime import java.time.format.DateTimeFormatter import java.util.* import java.util.concurrent.locks.Lock diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/ChusanApis.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/ChusanApis.kt index b22f73ec..44fd1c4e 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/ChusanApis.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/ChusanApis.kt @@ -6,6 +6,7 @@ import icu.samnyan.aqua.sega.chusan.model.response.data.MatchingMemberInfo import icu.samnyan.aqua.sega.chusan.model.response.data.MatchingWaitState import icu.samnyan.aqua.sega.chusan.model.response.data.UserEmoney import icu.samnyan.aqua.sega.chusan.model.userdata.UserCharge +import icu.samnyan.aqua.sega.chusan.model.userdata.UserItem import icu.samnyan.aqua.sega.chusan.model.userdata.UserMusicDetail import icu.samnyan.aqua.sega.general.model.response.UserRecentRating import java.time.format.DateTimeFormatter @@ -91,13 +92,26 @@ val chusanInit: ChusanController.() -> Unit = { } } + // Check dev/chusan_dev_notes for more item information + val penguins = ls(8000, 8010, 8020, 8030) + "GetUserItem".pagedWithKind("userItemList") { val rawIndex = data["nextIndex"]!!.long val kind = parsing { (rawIndex / 10000000000L).int } data["nextIndex"] = rawIndex % 10000000000L mapOf("itemKind" to kind) grabs { // TODO: All unlock - db.userItem.findAllByUser_Card_ExtIdAndItemKind(uid, kind) + val items = db.userItem.findAllByUser_Card_ExtIdAndItemKind(uid, kind).toMutableList() + + // Check game options + db.userData.findByCard_ExtId(uid)()?.card?.aquaUser?.gameOptions?.let { + if (it.chusanInfinitePenguins && kind == 5) { + items.removeAll { it.itemId in penguins } + items.addAll(penguins.map { UserItem(kind, it, 999, true) }) + } + } + + items } postProcess { val ni = it["nextIndex"]!!.long if (ni != -1L) it["nextIndex"] = ni + (kind * 10000000000L)