Aim-Assist Entity Exploder

Post your coolest Hexcasting creations here.

New topics are NOT for chatting or asking help, put those in the comments of a post or in a different forum.
User avatar
Robotgiggle
Posts: 22
Joined: Fri Dec 02, 2022 12:38 am

Aim-Assist Entity Exploder

Post by Robotgiggle »

Overview
This is a smart targeting system for combat spells that automatically locks on to the closest mob within a roughly cylindrical area around your look vector. Both the radius of the cylinder and the payload applied to the hit entity are very easy to customize, but the spell as written here uses a radius of 2 and hits whatever entity it finds with a power-3 safe explosion. Do note that, as with a typical entity raycast spell, this will mishap (harmlessly) if it fails to find any valid targets.
Diagram (radius not to scale)
Image
Customization
The radius of the cylinder is controlled by the Numerical Reflection inside the Thoth code block, right before the Zone Distillation: Living. If you change it, you may also want to tweak the distance between the center of each zone distillation to avoid unnecessary overlap – this distance is controlled by the Numerical Reflection right after the end of the Thoth code block. You'll also definitely want to update the Numerical Reflection for the final get-the-entity zone distillation to match whatever size you're using for the zone distillations that make up the cylinder.

I can also imagine a variety of tweaks that could improve the functionality of this technique. These include allowing the cylinder to target everything it intersects rather than just the first entity, implementing a check to make sure missed attacks don't mishap, or even adding a sentinel walker to allow the cylinder to extend past your 32-block ambit. I leave the implementation of these extra functions to those who are interested – including them here would bloat the code far past what's necessary for the basic function of the spell, which is already a bit lengthy.
Patterns
qaqaaeqqwawqaawqqqqeewdweddwwaawaadaaeqqwawqaawNumerical Reflection: 2qqqqqwdeddwdqaqedqdeqaqadeeeddwaawqqqaqdeedeeeqwaeawqawdddeaqqeeeqaqwaNumerical Reflection: 2waqawNumerical Reflection: 15aadaadaaNumerical Reflection: 15ewdqdwedadadqeewdweddwNumerical Reflection: 2qqqqqwdeddwdaaqwqaaddNumerical Reflection: 4aadaadaaaqawqadaqNumerical Reflection: 3aawaawaaqqaqaqqqqq

Code: Select all

// save starting position (your head) to ravenmind
Mind's Reflection
Compass' Purification
Huginn's Gambit
{
    // run a zone distillation at the current position
    Muninn's Reflection
    Additive Distillation
    Gemini Decomposition
    Huginn's Gambit
    Numerical Reflection: 2 // CYLINDER RADIUS
    Zone Distillation: Living
    // remove yourself from the results, if you're in them
    Mind's Reflection
    Integration Distillation
    Mind's Reflection
    Single's Purification
    Exclusion Distillation
    // if nothing was found, keep iterating, otherwise end the thoth
    Augur's Purification
    {
        Charon's Gambit
        Nullary Reflection
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
}
// generate 15 copies of (look vector * 2) for incrementing the position
Mind's Reflection
Alidade's Purification
Numerical Reflection: 2 // ITERATION STEP DISTANCE
Multiplicative Distillation
Numerical Reflection: 15
Gemini Gambit
Numerical Reflection: 15
Flock's Gambit
// run the loop
Thoth's Gambit
// redo the zone distillation from the most recent position
Muninn's Reflection
Numerical Reflection: 2 // FINAL ZONE RADIUS
Zone Distillation: Living
Speaker's Decomposition
// explode the first entity found
Compass' Purification II
Numerical Reflection: 4
Gemini Gambit
Create Water
Numerical Reflection: 3
Explosion
Conjure Block
Break Block