Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
power orb and other changes idk
Browse files Browse the repository at this point in the history
Signed-off-by: TomJuri <[email protected]>
  • Loading branch information
TomJuri committed Sep 24, 2023
1 parent 06ca4ec commit baf3057
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ class SwiftSlayerConfig : Config(Mod("SwiftSlayer", ModType.SKYBLOCK), "swiftsla
name = "MobKiller Weapon",
category = "General",
subcategory = "Slayer",
options = ["Spirit Sceptre", "Melee", "Frozen Scythe", "Fire Veil Wand"]
options = ["Spirit Sceptre", "Melee", "Fire Veil Wand"]
)
var mobKillerWeapon = 0

@Switch(
name = "Ignore Mini bosses",
category = "General",
subcategory = "Slayer",
)
var ignoreMiniBosses = false

@Dropdown(
name = "BossKiller Weapon",
category = "General",
Expand Down Expand Up @@ -78,6 +85,13 @@ class SwiftSlayerConfig : Config(Mod("SwiftSlayer", ModType.SKYBLOCK), "swiftsla
)
var useTuba = false

@Switch(
name = "Deploy Power Orb",
category = "General",
subcategory = "Support Items"
)
var deployOrb = false

@Slider(
name = "Failsafe volume",
category = "General",
Expand Down
13 changes: 13 additions & 0 deletions src/main/kotlin/dev/macrohq/swiftslayer/feature/SupportItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import dev.macrohq.swiftslayer.macro.MacroManager
import dev.macrohq.swiftslayer.util.InventoryUtil
import dev.macrohq.swiftslayer.util.KeyBindUtil
import dev.macrohq.swiftslayer.util.Logger
import dev.macrohq.swiftslayer.util.SlayerUtil
import dev.macrohq.swiftslayer.util.Timer
import dev.macrohq.swiftslayer.util.config
import dev.macrohq.swiftslayer.util.macroManager
Expand All @@ -19,6 +20,7 @@ class SupportItem {
private var health = -1
private var healingTimer = Timer(0)
private var tubaTimer = Timer(0)
private var orbTimer = Timer(0)

@SubscribeEvent
fun onTick(event: ClientTickEvent) {
Expand Down Expand Up @@ -48,6 +50,17 @@ class SupportItem {
Logger.error("No Wand of Healing found in hotbar!")
}
}
if (config.deployOrb && SlayerUtil.getState() == SlayerUtil.SlayerState.BOSS_ALIVE && orbTimer.isDone) {
val previousItem = player.inventory.currentItem
if (InventoryUtil.holdItem("Flux")) {
Logger.info("Using Power Orb.")
KeyBindUtil.rightClick()
orbTimer = Timer(30_000)
player.inventory.currentItem = previousItem
} else {
Logger.error("No Power Orb found in hotbar!")
}
}
}

@SubscribeEvent
Expand Down
20 changes: 11 additions & 9 deletions src/main/kotlin/dev/macrohq/swiftslayer/macro/GenericBossKiller.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import dev.macrohq.swiftslayer.util.PathingUtil
import dev.macrohq.swiftslayer.util.RotationUtil
import dev.macrohq.swiftslayer.util.SlayerUtil
import dev.macrohq.swiftslayer.util.config
import dev.macrohq.swiftslayer.util.gameSettings
import dev.macrohq.swiftslayer.util.getStandingOnCeil
import dev.macrohq.swiftslayer.util.player
import dev.macrohq.swiftslayer.util.setPressed
import dev.macrohq.swiftslayer.util.world
import net.minecraft.entity.EntityLiving
import net.minecraft.init.Blocks
import net.minecraft.util.BlockPos
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent

Expand All @@ -28,18 +29,19 @@ class GenericBossKiller {
if (target == null) return
if (SlayerUtil.getState() == SlayerUtil.SlayerState.BOSS_DEAD) {
Logger.info("Boss killed.")
gameSettings.keyBindSneak.setPressed(false)
disable()
return
}
gameSettings.keyBindSneak.setPressed(true)

// stay close to boss
RotationUtil.lock(target!!, 850, true)
if (player.getDistanceToEntity(target) > 2) {
if (!PathingUtil.isDone) return
PathingUtil.goto(target!!.getStandingOnCeil())
return

var y = target!!.getStandingOnCeil().y
while (world.getBlockState(BlockPos(target!!.posX, y.toDouble(), target!!.posZ)).block == Blocks.air) {
y--
}

if (player.getDistanceToEntity(target!!) > 4.5) {
PathingUtil.goto(BlockPos(target!!.posX, y.toDouble(), target!!.posZ))
} else {
PathingUtil.stop()
}
Expand Down
Loading

0 comments on commit baf3057

Please sign in to comment.