-
-
Notifications
You must be signed in to change notification settings - Fork 208
/
RiftAPI.kt
57 lines (45 loc) · 2.33 KB
/
RiftAPI.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package at.hannibal2.skyhanni.features.rift
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.config.features.rift.RiftConfig
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.skyblock.GraphAreaChangeEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.toInternalName
import net.minecraft.item.ItemStack
@SkyHanniModule
object RiftAPI {
fun inRift() = IslandType.THE_RIFT.isInIsland()
val config: RiftConfig get() = SkyHanniMod.feature.rift
// internal name -> motes
var motesPrice = emptyMap<NEUInternalName, Double>()
val farmingTool by lazy { "FARMING_WAND".toInternalName() }
private val blowgun by lazy { "BERBERIS_BLOWGUN".toInternalName() }
val ItemStack?.isBlowgun: Boolean
get() = this?.getInternalName() == blowgun
fun ItemStack.motesNpcPrice(): Double? {
val baseMotes = motesPrice[getInternalName()] ?: return null
val burgerStacks = config.motes.burgerStacks
val pricePer = baseMotes + (burgerStacks * 5) * baseMotes / 100
return pricePer * stackSize
}
var inMirrorVerse = false
var inRiftRace = false
var trackingButtons = false
var allButtonsHit = false
@HandleEvent
fun onAreaChange(event: GraphAreaChangeEvent) {
inMirrorVerse = event.area == "Mirrorverse"
}
fun inLivingCave() = LorenzUtils.skyBlockArea == "Living Cave"
fun inLivingStillness() = LorenzUtils.skyBlockArea == "Living Stillness"
fun inStillgoreChateau() = LorenzUtils.skyBlockArea.let { it == "Stillgore Château" || it == "Oubliette" }
fun inDreadfarm() = LorenzUtils.skyBlockArea == "Dreadfarm"
fun inWestVillage() = LorenzUtils.skyBlockArea.let { it == "West Village" || it == "Infested House" }
fun inMountainTop() = LorenzUtils.skyBlockArea.let { it == "Continuum" || it == "The Mountaintop" || it == "Trial Grounds"
|| it == "Time-Torn Isles" || it == "Wizardman Bureau" || it == "Wizard Brawl" || it == "Walk of Fame" || it == "Time Chamber" }
}