diff options
author | nea <nea@nea.moe> | 2023-06-11 02:43:14 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-06-11 02:43:14 +0200 |
commit | a36c8f1c0eae969dcee8cf690f12d9121350212d (patch) | |
tree | ea93f19bf5f77f8b5e42a7b56162d9b6492b7fed /src/main/kotlin/moe/nea/firmament/apis/Profiles.kt | |
parent | 040f7c7275568d783bfa5e4ed20412f72d126549 (diff) | |
download | firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.tar.gz firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.tar.bz2 firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.zip |
Add collection info to skill page
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/apis/Profiles.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/apis/Profiles.kt | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt index 4d4f370..ae23349 100644 --- a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt +++ b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt @@ -20,6 +20,32 @@ import moe.nea.firmament.util.json.InstantAsLongSerializer @Serializable +data class CollectionSkillData( + val items: Map<CollectionType, CollectionInfo> +) + +@Serializable +data class CollectionResponse( + val success: Boolean, + val collections: Map<Skill, CollectionSkillData> +) + +@Serializable +data class CollectionInfo( + val name: String, + val maxTiers: Int, + val tiers: List<CollectionTier> +) + +@Serializable +data class CollectionTier( + val tier: Int, + val amountRequired: Long, + val unlocks: List<String>, +) + + +@Serializable data class Profiles( val success: Boolean, val profiles: List<Profile>? @@ -35,18 +61,18 @@ data class Profile( val members: Map<UUID, Member>, ) -enum class Skill(val accessor: KProperty1<Member, Double>, val color: DyeColor) { - FARMING(Member::experienceSkillFarming, DyeColor.YELLOW), - FORAGING(Member::experienceSkillForaging, DyeColor.BROWN), - MINING(Member::experienceSkillMining, DyeColor.LIGHT_GRAY), - ALCHEMY(Member::experienceSkillAlchemy, DyeColor.PURPLE), - TAMING(Member::experienceSkillTaming, DyeColor.GREEN), - FISHING(Member::experienceSkillFishing, DyeColor.BLUE), - RUNECRAFTING(Member::experienceSkillRunecrafting, DyeColor.PINK), - CARPENTRY(Member::experienceSkillCarpentry, DyeColor.ORANGE), - COMBAT(Member::experienceSkillCombat, DyeColor.RED), - SOCIAL(Member::experienceSkillSocial, DyeColor.WHITE), - ENCHANTING(Member::experienceSkillEnchanting, DyeColor.MAGENTA), +enum class Skill(val accessor: KProperty1<Member, Double>, val color: DyeColor, val icon: SkyblockId) { + FARMING(Member::experienceSkillFarming, DyeColor.YELLOW, SkyblockId("ROOKIE_HOE")), + FORAGING(Member::experienceSkillForaging, DyeColor.BROWN, SkyblockId("TREECAPITATOR_AXE")), + MINING(Member::experienceSkillMining, DyeColor.LIGHT_GRAY, SkyblockId("DIAMOND_PICKAXE")), + ALCHEMY(Member::experienceSkillAlchemy, DyeColor.PURPLE, SkyblockId("BREWING_STAND")), + TAMING(Member::experienceSkillTaming, DyeColor.GREEN, SkyblockId("SUPER_EGG")), + FISHING(Member::experienceSkillFishing, DyeColor.BLUE, SkyblockId("FARMER_ROD")), + RUNECRAFTING(Member::experienceSkillRunecrafting, DyeColor.PINK, SkyblockId("MUSIC_RUNE;1")), + CARPENTRY(Member::experienceSkillCarpentry, DyeColor.ORANGE, SkyblockId("WORKBENCH")), + COMBAT(Member::experienceSkillCombat, DyeColor.RED, SkyblockId("UNDEAD_SWORD")), + SOCIAL(Member::experienceSkillSocial, DyeColor.WHITE, SkyblockId("EGG_HUNT")), + ENCHANTING(Member::experienceSkillEnchanting, DyeColor.MAGENTA, SkyblockId("ENCHANTMENT_TABLE")), ; fun getMaximumLevel(leveling: Leveling) = leveling.maximumLevels[name.lowercase()] ?: TODO("Repo error") @@ -59,6 +85,12 @@ enum class Skill(val accessor: KProperty1<Member, Double>, val color: DyeColor) } @Serializable +@JvmInline +value class CollectionType(val string: String) { + val skyblockId get() = SkyblockId(string.replace(":", "-").replace("MUSHROOM_COLLECTION", "HUGE_MUSHROOM_2")) +} + +@Serializable data class Member( val pets: List<Pet> = listOf(), @SerialName("coop_invitation") @@ -85,6 +117,7 @@ data class Member( val experienceSkillRunecrafting: Double = 0.0, @SerialName("experience_skill_carpentry") val experienceSkillCarpentry: Double = 0.0, + val collection: Map<CollectionType, Long> = mapOf() ) @Serializable |