From 991972216e9e4d84544d2bf81773158f75e9b6b7 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 25 Oct 2022 16:41:46 +0700 Subject: [PATCH] Fix android research refund refunding "levels" of experience Fixes #184 --- .../ru/dbotthepony/mc/otm/android/AndroidResearch.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt index 20e4ffae9..0b1fc9484 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt @@ -172,7 +172,17 @@ class AndroidResearch(val type: AndroidResearchType, val capability: MatteryPlay } if (type.experienceLevels > 0) { - capability.ply.giveExperienceLevels(type.experienceLevels) + var experiencePoints = 0 + + for (level in 0 until type.experienceLevels) { + experiencePoints += when (level) { + in 0 .. 14 -> 7 + level * 2 + in 15 .. 29 -> 37 + (level - 15) * 5 + else -> 112 + (level - 30) * 9 + } + } + + capability.ply.giveExperiencePoints(experiencePoints) } for (item in type.items) {