|
| 1 | +package com.lambda.module.modules.combat |
| 2 | + |
| 3 | +import com.lambda.config.InteractionSettings |
| 4 | +import com.lambda.config.RotationSettings |
| 5 | +import com.lambda.event.events.RotationEvent |
| 6 | +import com.lambda.event.events.TickEvent |
| 7 | +import com.lambda.event.listener.SafeListener.Companion.concurrentListener |
| 8 | +import com.lambda.event.listener.SafeListener.Companion.listener |
| 9 | +import com.lambda.module.Module |
| 10 | +import com.lambda.module.tag.ModuleTag |
| 11 | +import com.lambda.util.Communication.info |
| 12 | +import com.lambda.util.combat.Explosion.velocity |
| 13 | +import com.lambda.util.world.EntityUtils.getClosestEntity |
| 14 | +import com.lambda.util.world.EntityUtils.getFastEntities |
| 15 | +import net.minecraft.entity.Entity |
| 16 | +import net.minecraft.entity.LivingEntity |
| 17 | +import net.minecraft.util.Hand |
| 18 | +import net.minecraft.world.explosion.Explosion |
| 19 | + |
| 20 | +object CrystalAura : Module( |
| 21 | + name = "CrystalAura", |
| 22 | + description = "Automatically attacks entities with crystals", |
| 23 | + defaultTags = setOf(ModuleTag.COMBAT), |
| 24 | +) { |
| 25 | + private val page by setting("Page", Page.General) |
| 26 | + |
| 27 | + /* Rotation */ |
| 28 | + private val rotation = RotationSettings(this) { page == Page.Targeting } |
| 29 | + |
| 30 | + /* Placing */ |
| 31 | + private val swap by setting("Swap", Hand.MAIN_HAND, "Automatically swap to crystals") { page == Page.Placing } |
| 32 | + private val multiPlace by setting("Multi Place", true, "Place multiple crystals") { page == Page.Placing } |
| 33 | + private val placeDelay by setting("Place Delay", 0, 0..20, 1, "Delay between crystal placements", unit = "ticks", visibility = { page == Page.Placing }) |
| 34 | + private val placeRange by setting("Place Range", 5.0, 0.1..7.0, 0.1, "Range to place crystals from the player eyes", visibility = { page == Page.Placing }) |
| 35 | + private val placeRangeWalls by setting("Place Range Walls", 3.5, 0.1..7.0, 0.1, "Range to place crystals through walls", visibility = { page == Page.Placing }) |
| 36 | + private val placeMinHealth by setting("Place Min Health", 10.0, 0.0..20.0, 0.5, "Minimum health to place a crystal", visibility = { page == Page.Placing }) |
| 37 | + private val placeMaxSelfDamage by setting("Place Max Self Damage", 8.0, 0.0..20.0, 0.5, "Maximum self damage to place a crystal", visibility = { page == Page.Placing }) |
| 38 | + private val placeMinDamage by setting("Place Min Damage", 6.0, 0.0..20.0, 0.5, "Minimum damage to place a crystal", visibility = { page == Page.Placing }) |
| 39 | + |
| 40 | + /* Exploding */ |
| 41 | + private val explode by setting("Explode", true, "Explode crystals") { page == Page.Exploding } |
| 42 | + private val explodeDelay by setting("Explode Delay", 0, 0..20, 1, "Delay between crystal explosions", unit = "ticks", visibility = { page == Page.Exploding }) |
| 43 | + private val explodeRange by setting("Explode Range", 5.0, 0.1..7.0, 0.1, "Range to explode crystals", visibility = { page == Page.Exploding }) |
| 44 | + private val explodeRangeWalls by setting("Explode Range Walls", 3.5, 0.1..7.0, 0.1, "Range to explode crystals through walls", visibility = { page == Page.Exploding }) |
| 45 | + private val preventDeath by setting("Prevent Death", true, "Prevent death from crystal explosions", visibility = { page == Page.Exploding }) |
| 46 | + private val explodeMinDamage by setting("Explode Min Damage", 6.0, 0.0..20.0, 0.5, "Minimum damage to explode a crystal", visibility = { page == Page.Exploding }) |
| 47 | + private val noWeakness by setting("No Weakness", true, "Switch to a weapon when you have a weakness effect", visibility = { page == Page.Exploding }) |
| 48 | + |
| 49 | + /* Rendering */ |
| 50 | + |
| 51 | + |
| 52 | + /* Interaction */ |
| 53 | + private val interac = InteractionSettings(this) // Canadian interbank meme |
| 54 | + |
| 55 | + private enum class Page { |
| 56 | + General, Targeting, Placing, Exploding, Rendering |
| 57 | + } |
| 58 | + |
| 59 | + init { |
| 60 | + concurrentListener<TickEvent.Pre> {} |
| 61 | + |
| 62 | + /*listener<RotationEvent.Pre> { event -> |
| 63 | + event.lookAtEntity(rotation, interac, getClosestEntity<LivingEntity>(player.eyePos, placeRange) ?: return@listener) |
| 64 | + }*/ |
| 65 | + |
| 66 | + listener<TickEvent.Pre> { |
| 67 | + getClosestEntity<LivingEntity>(player.eyePos, 64.0) |
| 68 | + } |
| 69 | + } |
| 70 | +} |
0 commit comments