diff options
Diffstat (limited to 'src/main/java')
15 files changed, 502 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index f99a0ee2b..296098f37 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -30,6 +30,7 @@ import at.hannibal2.skyhanni.features.minion.MinionFeatures; import at.hannibal2.skyhanni.features.misc.*; import at.hannibal2.skyhanni.features.nether.MilleniaAgedBlazeColor; import at.hannibal2.skyhanni.features.nether.ashfang.*; +import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper; import at.hannibal2.skyhanni.features.slayer.EndermanSlayerBeacon; import at.hannibal2.skyhanni.features.slayer.HideMobNames; import at.hannibal2.skyhanni.features.slayer.HighlightSlayerMiniboss; @@ -171,6 +172,8 @@ public class SkyHanniMod { loadModule(new BrewingStandOverlay()); loadModule(new BazaarUpdateTimer()); + loadModule(new CrimsonIsleReputationHelper(this)); + Commands.INSTANCE.init(); loadModule(new LorenzTest()); diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt new file mode 100644 index 000000000..4cbea0f23 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -0,0 +1,56 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.HyPixelData +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.DailyQuestHelper +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings +import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.TickEvent + +class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { + + private val questHelper = DailyQuestHelper(this) + + init { + skyHanniMod.loadModule(questHelper) + } + + private val display = mutableListOf<String>() + private var dirty = true + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + if (dirty) { + dirty = false + updateRender() + } + } + + private fun updateRender() { + display.clear() + + display.add("Reputation Helper:") + display.add("") + questHelper.renderAllQuests(display) + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + fun renderOverlay(event: RenderGameOverlayEvent.Post) { + if (event.type != RenderGameOverlayEvent.ElementType.ALL) return + + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + + SkyHanniMod.feature.dev.debugPos.renderStrings(display) + } + + fun update() { + dirty = true + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt new file mode 100644 index 000000000..c0be20536 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -0,0 +1,223 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest + +import at.hannibal2.skyhanni.data.HyPixelData +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent +import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.* +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.TickEvent + +class DailyQuestHelper(private val reputationHelper: CrimsonIsleReputationHelper) { + + val quests = mutableListOf<Quest>() + private var tick = 0 + + private val loader = QuestLoader(this) + + private val sacksCache = mutableMapOf<String, Long>() + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + tick++ + if (tick % 3 == 0) { + loader.checkInventory() + } + if (tick % 60 == 0) { + checkInventoryForFetchItem() + } + + if (tick % 60 == 0) { + loader.loadFromTabList() + + if (quests.size != 5) { + quests.clear() + LorenzUtils.chat("§e[SkyHanni] Reset Quests.") + } + } + } + + fun update() { + reputationHelper.update() + } + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + if (event.gui !is GuiChest) return + val chest = event.gui.inventorySlots as ContainerChest + val chestName = chest.getInventoryName() + + if (chestName == "Challenges") { + if (LorenzUtils.skyBlockArea != "Dojo") return + val dojoQuest = getQuest<DojoQuest>() ?: return + if (dojoQuest.state != QuestState.ACCEPTED) return + + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + val stack = slot.stack ?: continue + val itemName = stack.name ?: continue + + if (itemName.contains(dojoQuest.dojoName)) { + slot highlight LorenzColor.AQUA + } + } + } + if (chestName == "Sack of Sacks") { + val fetchQuest = getQuest<FetchQuest>() ?: return + if (fetchQuest.state != QuestState.ACCEPTED) return + + val fetchItem = fetchQuest.itemName + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + val stack = slot.stack ?: continue + if (stack.getLore().any { it.contains(fetchItem) }) { + slot highlight LorenzColor.AQUA + } + } + } + if (chestName.contains("Nether Sack")) { + val fetchQuest = getQuest<FetchQuest>() ?: return + if (fetchQuest.state != QuestState.ACCEPTED) return + + val fetchItem = fetchQuest.itemName + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + val stack = slot.stack ?: continue + val itemName = stack.name ?: continue + + if (itemName.contains(fetchItem)) { + slot highlight LorenzColor.AQUA + } + } + } + } + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + + val message = event.message + + if (message == "§aYou completed your Dojo quest! Visit the Town Board to claim the rewards.") { + val dojoQuest = getQuest<DojoQuest>() ?: return + dojoQuest.state = QuestState.READY_TO_COLLECT + update() + } + } + + private inline fun <reified T : Quest> getQuest(): T? { + return quests.filterIsInstance<T>().firstOrNull() + } + + private fun checkInventoryForFetchItem() { + val fetchQuest = getQuest<FetchQuest>() ?: return + if (fetchQuest.state != QuestState.ACCEPTED && fetchQuest.state != QuestState.READY_TO_COLLECT) return + + val itemName = fetchQuest.itemName + + val player = Minecraft.getMinecraft().thePlayer + var count = 0 + for (stack in player.inventory.mainInventory) { + if (stack == null) continue + val name = stack.name ?: continue + if (name.contains(itemName)) { + count += stack.stackSize + } + } + + val needAmount = fetchQuest.needAmount + if (count > needAmount) { + count = needAmount + } + if (fetchQuest.haveAmount == count) return + + fetchQuest.haveAmount = count + fetchQuest.state = if (count == needAmount) QuestState.READY_TO_COLLECT else QuestState.ACCEPTED + update() + } + + @SubscribeEvent + fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) { + val profileData = event.profileData + val sacks = profileData["sacks_counts"]?.asJsonObject ?: return + + sacksCache.clear() + + for ((name, v) in sacks.entrySet()) { + val amount = v.asLong + sacksCache[name] = amount + } + update() + } + + fun renderAllQuests(display: MutableList<String>) { + val done = quests.count { it.state == QuestState.COLLECTED } +// val sneaking = Minecraft.getMinecraft().thePlayer.isSneaking +// if (done != 5 || sneaking) { + if (done != 5) { + display.add("Daily Quests (collected $done/5)") + for (quest in quests) { +// if (!sneaking) { +// if (quest.state == QuestState.COLLECTED) { +// continue +// } +// } + display.add(renderQuest(quest)) + } + } + } + + private fun renderQuest(quest: Quest): String { + val type = quest.category.displayName + val state = quest.state.displayName + val stateColor = quest.state.color + val displayName = quest.displayName + + val multipleText = if (quest is ProgressQuest && quest.state != QuestState.COLLECTED) { + val haveAmount = quest.haveAmount + val needAmount = quest.needAmount + " §e$haveAmount§8/§e$needAmount" + } else { + "" + } + + val sacksText = if (quest is FetchQuest && quest.state != QuestState.COLLECTED) { + val name = quest.itemName.uppercase() + val amount = sacksCache.getOrDefault(name, -1) + val needAmount = quest.needAmount + val color = if (amount >= needAmount) { + "§a" + } else { + "§c" + } + val format = if (amount == -1L) { + "§c?" + } else { + color + LorenzUtils.formatInteger(amount) + } + " §f($format §fin sacks)" + } else { + "" + } + return "$stateColor[$state] §f$type: §f$displayName$multipleText$sacksText" + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt new file mode 100644 index 000000000..df8c7dede --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt @@ -0,0 +1,146 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest + +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.* +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.TabListUtils +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest + +class QuestLoader(val dailyQuestHelper: DailyQuestHelper) { + + fun loadFromTabList() { +// println(" ") +// println("#####") +// println(" ") + + var i = -1 + for (line in TabListUtils.getTabList()) { + if (line.contains("Faction Quests:")) { + i = 0 + continue + } + if (i == -1) continue + + i++ + readQuest(line) + if (i == 5) { + break + } + } + } + + private fun readQuest(line: String) { + var text = line.substring(3) + val green = text.startsWith("§a") + text = text.substring(2) + + val amount: Int + val name: String + if (text.contains(" §r§8x")) { + val split = text.split(" §r§8x") + name = split[0] + amount = split[1].toInt() + } else { + name = text + amount = 1 + } + + checkQuest(name, green, amount) + +// println("line: '$line'") +// println("green: '$green'") +// println("name: '$name'") +// println("amount: '$amount'") +// println(" ") + } + + private fun checkQuest(name: String, green: Boolean, amount: Int) { + val oldQuest = getQuestByName(name) + if (oldQuest != null) { + if (green) { + if (oldQuest.state != QuestState.READY_TO_COLLECT && oldQuest.state != QuestState.COLLECTED) { + oldQuest.state = QuestState.READY_TO_COLLECT + dailyQuestHelper.update() + LorenzUtils.debug("Tablist updated ${oldQuest.internalName} (This should not happen)") + } + } + return + } + + val state = if (green) QuestState.READY_TO_COLLECT else QuestState.NOT_ACCEPTED + dailyQuestHelper.update() + dailyQuestHelper.quests.add(addQuest(name, state, amount)) + } + + private fun addQuest( + name: String, + state: QuestState, + amount: Int + ): Quest { + //Trophy Fish + if (name == "Lavahorse") return TrophyFishQuest(name, state, amount) + + //Rescue Mission + if (name == "Rescue Mission") return RescueMissionQuest(state) + + //Boss + if (name == "Magma Boss") return BossQuest(name, state, amount) + + //Fetch + if (name == "Magmag") return FetchQuest(name, state, amount) + + if (name.startsWith("Mastery Rank ")) { + val split = name.split(" Rank ") + val dojoName = split[0] + val dojoRankGoal = split[1] + return DojoQuest(dojoName, dojoRankGoal, state) + } + + println("Unknown quest: '$name'") + return UnknownQuest(name) + } + + private fun getQuestByName(name: String): Quest? { + return dailyQuestHelper.quests.firstOrNull { it.internalName == name } + } + + fun checkInventory() { + if (LorenzUtils.skyBlockArea != "Community Center") return + + val gui = Minecraft.getMinecraft().currentScreen + if (gui !is GuiChest) return + val chest = gui.inventorySlots as ContainerChest + val name = chest.getInventoryName() + + for (quest in dailyQuestHelper.quests) { + val categoryName = quest.category.name + if (categoryName.equals(name, ignoreCase = true)) { + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + val stack = slot.stack ?: continue + + val completed = stack.getLore().any { it.contains("Completed!") } + println("completed: $completed") + if (completed) { + if (quest.state != QuestState.COLLECTED) { + quest.state = QuestState.COLLECTED + dailyQuestHelper.update() + } + } + + val accepted = !stack.getLore().any { it.contains("not accepted") } + if (accepted) { + if (quest.state == QuestState.NOT_ACCEPTED) { + quest.state = QuestState.ACCEPTED + dailyQuestHelper.update() + } + } + } + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/BossQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/BossQuest.kt new file mode 100644 index 000000000..c6f469243 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/BossQuest.kt @@ -0,0 +1,4 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +class BossQuest(bossName: String, state: QuestState, needAmount: Int) : + ProgressQuest(QuestCategory.MINIBOSS, bossName, state, needAmount)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt new file mode 100644 index 000000000..69353de07 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +import at.hannibal2.skyhanni.utils.LorenzUtils + +class DojoQuest(public val dojoName: String, dojoRankGoal: String, state: QuestState) : + Quest( + QuestCategory.DOJO, + "$dojoName Rank $dojoRankGoal", + state, + "$dojoName (" + LorenzUtils.getPointsForDojoRank(dojoRankGoal) + " points)" + ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/FetchQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/FetchQuest.kt new file mode 100644 index 000000000..d815f9a76 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/FetchQuest.kt @@ -0,0 +1,4 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +class FetchQuest(val itemName: String, state: QuestState, needAmount: Int) : + ProgressQuest(QuestCategory.FETCH, itemName, state, needAmount)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/ProgressQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/ProgressQuest.kt new file mode 100644 index 000000000..938afb483 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/ProgressQuest.kt @@ -0,0 +1,9 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +abstract class ProgressQuest( + questCategory: QuestCategory, + displayName: String, + state: QuestState, + val needAmount: Int, + var haveAmount: Int = 0 +) : Quest(questCategory, displayName, state)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt new file mode 100644 index 000000000..95bf91cd9 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/Quest.kt @@ -0,0 +1,4 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +abstract class Quest(val category: QuestCategory, val internalName: String, var state: QuestState, val displayName: String = internalName) { +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt new file mode 100644 index 000000000..29645f9b5 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +enum class QuestCategory(val displayName: String) { + FISHING("Trophy Fish"), + RESCUE("Rescue Mission"), + MINIBOSS("Crimson Boss"), + FETCH("Item Fetch"), + DOJO("Dojo"), + + UNKNOWN("§cUnknown"), +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt new file mode 100644 index 000000000..acde3785d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt @@ -0,0 +1,8 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +enum class QuestState(val displayName: String, val color: String) { + NOT_ACCEPTED("Not Accepted", "§c"), + ACCEPTED("Accepted", "§b"), + READY_TO_COLLECT("Ready to collect", "§a"), + COLLECTED("Collected", "§7"), +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/RescueMissionQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/RescueMissionQuest.kt new file mode 100644 index 000000000..71b201047 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/RescueMissionQuest.kt @@ -0,0 +1,3 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +class RescueMissionQuest(state: QuestState): Quest(QuestCategory.RESCUE, "Rescue Mission", state, "Rescue the NPC")
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/TrophyFishQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/TrophyFishQuest.kt new file mode 100644 index 000000000..b7de86eba --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/TrophyFishQuest.kt @@ -0,0 +1,4 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +class TrophyFishQuest(fishName: String, state: QuestState, needAmount: Int) : + ProgressQuest(QuestCategory.FISHING, fishName, state, needAmount)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt new file mode 100644 index 000000000..197ee3bce --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt @@ -0,0 +1,4 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest + +class UnknownQuest(unknownName: String): Quest(QuestCategory.UNKNOWN, unknownName, QuestState.NOT_ACCEPTED) { +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 9d783ce86..7dea12015 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -144,4 +144,16 @@ object LorenzUtils { } return null } + + fun getPointsForDojoRank(rank: String): Int { + return when (rank) { + "S" -> 1000 + "A" -> 800 + "B" -> 600 + "C" -> 400 + "D" -> 200 + "F" -> 0 + else -> 0 + } + } }
\ No newline at end of file |