Smart Railgun

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
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Smart Railgun

Post by [object Object] »

This hex launches the nearest arrow exactly fast enough to kill the entity you're looking at (not accounting for armour), using unit impulse stacking to minimize the cost (meaning it "only" costs 309 dust to kill a wither, instead of 24 025).

Since it can't account for the entity's armour (Hexal has no pattern for that), it adds a constant 10 hp so it can actually kill the wither. It's commented, feel free to remove if you want. Also, if you want to use this on any armoured target, you could instead multiply the calculated velocity by 1.5 or 2 or something, or just use a constant, large velocity instead of basing it on the target's health.

Video demo

Code: Select all

{
    Consideration: {
        Gemini Decomposition
        Stadiometer's Purification
        Numerical Reflection: 0.5
        Equality Distillation
        Undertaker's Gambit

        {
            Gemini Decomposition
            Pace Purification
            Prospector's Gambit
            Compass' Purification

            Mind's Reflection
            Compass' Purification
            Mind's Reflection
            Alidade's Purification
            Scout's Distillation
            
            Gemini Decomposition
            Compass' Purification
            Rotation Gambit
            Subtractive Distillation

            Gemini Decomposition
            Length Purification
            Division Distillation
            
            Jester's Gambit
            Nurse's Purification

            // optional: extra damage to deal with wither armour
            Numerical Reflection: 10
            Additive Distillation

            Numerical Reflection: 2
            Division Distillation

            Undertaker's Gambit
            Multiplicative Distillation
            Rotation Gambit
            Subtractive Distillation
            
            Gemini Decomposition
            Length Purification
            Division Distillation
            
            Jester's Gambit
            Gemini's Gambit
            
            Flock's Reflection
            Numerical Reflection: 2
            Subtractive Distillation
            Flock's Gambit
            
            {
                Impulse
            }
            Jester's Gambit
            Thoth's Gambit
            Bookkeeper's Gambit: vv
        }
        {
            Bookkeeper's Gambit: v
        }
        Flock's Disintegration
        Augur's Exaltation
        Hermes' Gambit

        {
            Charon's Gambit
            Bookkeeper's Gambit: -
        }
        Flock's Disintegration
        Augur's Exaltation
        Hermes' Gambit
    Consideration: }

    Mind's Reflection
    Compass' Purification
    Numerical Reflection: 32
    Dioscuri Gambit
    Dioscuri Gambit

    Zone Distillation: Non-Item
    Rotation Gambit II
    Zone Distillation: Non-Living
    Intersection Distillation
    Rotation Gambit II
    Zone Distillation: Non-Wisp
    Intersection Distillation

    // show a message if no potential arrows are in range
    Gemini Decomposition
    Augur's Purification
    {
        Bookkeeper's Gambit: -
        Reveal
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit

    Thoth's Gambit
}
IntrospectionConsiderationIntrospectionGemini DecompositionStadiometer's PurificationNumerical Reflection: 0.5Equality DistillationUndertaker's GambitIntrospectionGemini DecompositionPace PurificationProspector's GambitCompass' PurificationMind's ReflectionCompass' PurificationMind's ReflectionAlidade's PurificationScout's DistillationGemini DecompositionCompass' PurificationRotation GambitSubtractive DistillationGemini DecompositionLength PurificationDivision Dstl.Jester's GambitaqwawqaNumerical Reflection: 10Additive DistillationNumerical Reflection: 2Division Dstl.Undertaker's GambitMultiplicative Dstl.Rotation GambitSubtractive DistillationGemini DecompositionLength PurificationDivision Dstl.Jester's GambitGemini GambitFlock's ReflectionNumerical Reflection: 2Subtractive DistillationFlock's GambitIntrospectionImpulseRetrospectionJester's GambitThoth's GambitBookkeeper's Gambit: Drop 2RetrospectionIntrospectionBookkeeper's Gambit: Drop 1RetrospectionFlock's DisintegrationAugur's ExaltationHermes' GambitIntrospectionCharon's GambitBookkeeper's Gambit: Keep 1RetrospectionFlock's DisintegrationAugur's ExaltationHermes' GambitConsiderationRetrospectionMind's ReflectionCompass' PurificationNumerical Reflection: 32Dioscuri GambitDioscuri GambitZone Distillation: Non-ItemRotation Gambit IIZone Distillation: Non-LivingIntersection DistillationRotation Gambit IIeewaqaweewaqaawwIntersection DistillationGemini DecompositionAugur's PurificationIntrospectionBookkeeper's Gambit: Keep 1RevealRetrospectionFlock's DisintegrationAugur's ExaltationHermes' GambitThoth's GambitRetrospection
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Smart Railgun II

Post by [object Object] »

The best railgun yet.
This is a hex in two parts that work together as a combat-ready smart railgun. First, a Quiver Wisp is summoned that collects and holds all nearby arrows (including those fired by skeletons) for later use. Then, the Smart Railgun II fires a nearby arrow (usually from the quiver, but airborne arrows can and will be used) with the caster's own media reserves, accelerating it just enough to kill the target. If a quiver is active, the railgun communicates with the quiver along a link so that the quiver doesn't try to collect arrows fired by the railgun.

Be aware that if a mob's health is low enough, the arrow may not be accelerated fast enough to actually hit the target. If you use the optional Armor Compensator macro, it can one-shot armored targets, but it still can't account for enchantments.

The hexes are listed separately to make them easier to draw and verify, but I recommend combining them with Knitting Needle. Both hexes use Stuck Arrow Filter as a template, and I recommend using Locator's Scalpel to insert the pattern lists, as instructed by the comments in each hex.

Video demo

Hexes

Quiver Wisp
Media usage: ~108 dust
Macros used: Huginn's Gambit II, Minimization Distillation (both defined below)
Replacement for Thoth's Gambit
qqqqeewdweddwddqaawaweaqadwaeaqadadadeee
Replacement for Numerical Reflection: 31
qqqNumerical Reflection: 7eee
Replacement for Mind's Reflection
qqqaaeddeee
Replacement for Reveal
qqqaadadaawddaawddddwddwaadaawqaqwaadaaNumerical Reflection: 0.25eddqddwdedwNumerical Reflection: -5wdedwqqqqqawddaaeddwqaadaawqaqwddqaawdedwaawddNumerical Reflection: 1qaawaqawwddwawqqqwaqweee
Main hex
qqqqqqqqaeaaeeqqwawqaawawqqqaweeeeewaaawqqqqeewdweddwweeeeewedqdeaweaqaeqqwawqaaweeeNumerical Reflection: 2aadaqaeaqqqqBookkeeper's Gambit: Drop 1eeeqwaeawqawdddeaqqeeeaadaadeaqqdeeeeqaqaaqqqqqewaadadaawwqaawddaadaadadqqqBookkeeper's Gambit: Drop 1Numerical Reflection: 5eeeqqqqaqaawddwwqaqwNumerical Reflection: 1wddwNumerical Reflection: 5qaaeeeawdddeaqqwaqawwaawddqaaNumerical Reflection: 50aqaweewaqaweeqqwdedwqqdaqaawwaadaaaqweewqaeaqweewqaqwwweaqaaeqqqqqaweaqaaweee

Code: Select all

// macros
#define Huginn's Gambit II (NORTH_WEST eqqwawqaawaw) = any ->
#define Minimization Distillation (SOUTH_WEST qaa) = num, num -> num

// template: Stuck Arrow Filter
// use Locator's Scalpel for replacements in the order they're written

// replacement for Thoth's Gambit
{
    Muninn's Reflection
    Undertaker's Gambit
    Unifying Distillation
    Exclusionary Distillation
    Thoth's Gambit
}

// replacement for Numerical Reflection: 31
{
    Numerical Reflection: 7
}

// replacement for Mind's Reflection
{
    Prospector's Gambit
}

// replacement for Reveal
{
    // -1/5 r^ if |r| > 0.25
    Dioscuri Gambit
    Compass' Purification II
    Jester's Gambit
    Compass' Purification II
    Subtractive Distillation
    
    Gemini Decomposition
    Length Purification
    Gemini Decomposition
    Numerical Reflection: 0.25
    Maximus Distillation
    Rotation Gambit II

    Division Distillation
    Numerical Reflection: -5
    Division Distillation
    Vector Reflection Zero
    Augur's Exaltation
    
    // -v
    Prospector's Gambit
    Pace Purification
    Gemini Decomposition
    Length Purification
    Undertaker's Gambit
    Division Distillation

    Jester's Gambit
    Numerical Reflection: 1
    Minimization Distillation
    Multiplicative Distillation
    Subtractive Distillation
    
    Impulse
}

// main hex (insert the filled template into this, not the other way around)
{
    {
        Vacant Reflection
        Huginn's Gambit II

        {
            Postmaster's Reflection
            Augur's Purification

            {
                Muninn's Reflection
                Recitation Reflection
                Integration Distillation
                Uniqueness Purification
                Huginn's Gambit
            }
            Numerical Reflection: 2
            Fisherman's Gambit II
            Combination Distillation

            {
                Bookkeeper's Gambit: v
            }
            Flock's Disintegration
            
            Augur's Exaltation
            Hermes' Gambit
        }
        Gemini Decomposition
        Hermes' Gambit
        
        // placeholder for filled Stuck Arrow Filter patterns
        Reveal
    }

    Mind's Reflection
    Compass' Purification
    Vector Reflection +Y
    Dioscuri Gambit
    Archer's Distillation

    Gemini Decomposition
    Nullary Reflection
    Equality Distillation
    {
        Bookkeeper's Gambit: v
        Numerical Reflection: 5
    }
    {
        Mind's Reflection
        Compass' Purification
        Subtractive Distillation
        Length Purification

        Numerical Reflection: 1
        Subtractive Distillation
        Numerical Reflection: 5
        Minimization Distillation
    }
    Augur's Exaltation
    Hermes' Gambit

    Multiplicative Distillation
    Additive Distillation
    Undertaker's Gambit
    
    Numerical Reflection: 50
    Summon Cyclic Wisp

    Entity Purification: Wisp
    Gemini Decomposition
    Bind Wisp // optional, i'm not sure if the cost (50 dust!) is worth it for this application
    Link
}
Smart Railgun II
Dust cost: Target health * 2/divisor - 1 (see below)
Macros used: Conditional Continue, Linear Impulse, Armor Compensator (optional)

This hex gets cheaper with higher levels of Power on your bow, since the Power enchantment acts as a straight damage multiplier. As explained in the table below and a comment in the code, you can change a value in this hex to make it work with any power level. This makes the arrow slower, so using it with lower power levels won't work, and it may have less range against weak mobs.

Power enchantment — Health divisor — Dust to kill a creeper
0 — 2.0 — 19
1 — 3.0 — 12.3
2 — 3.5 — 10.4
3 — 4.0 — 9
4 — 4.5 — 7.9
5 — 5.0 — 7
Replacement for Thoth's Gambit
qqqNumerical Reflection: -1eqqwawqaawdadadqeewdweddwdeBookkeeper's Gambit: Drop 1eee
Replacement for Reveal
qqqqeewdweddwNumerical Reflection: 1waawaadaaeqqwawqaawNumerical Reflection: 0daaqdeeddqaqaaqaqwaweaqaaadaadadaqdeeddaaqqqqqdaqaawdaadaadadaaeddqaqadwawaqdeeddaadadaawaaaawddddwddwaadaawqaqwwdedwaawddaadaaaqwawqaNumerical Reflection: 2wdedwwqqqqwwddwaqawaaeddNumerical Reflection: 0aaeddqeeeeedwwawqqqqqqqqwdeddwBookkeeper's Gambit: Drop 2eeeqwaeawqawdddeaqqwqwddwawqqqwaqwweee

Code: Select all

// macros
#define Conditional Continue (SOUTH_WEST aqdeedd) = bool ->
#define Linear Impulse (SOUTH_WEST awqqqwaqww) = entity, vector ->
#define Armor Compensator (NORTH_WEST wqqqqwwdd) = entity, num -> num

// template: Stuck Arrow Filter

// replacement for Thoth's Gambit
// show number of remaining usable arrows nearby
{
    Numerical Reflection: -1
    Huginn's Gambit
    Thoth's Gambit
    Muninn's Reflection
    Reveal
    Bookkeeper's Gambit: v
}

// replacement for Reveal
{
    // increment arrow count
    Muninn's Reflection
    Numerical Reflection: 1
    Additive Distillation
    Gemini Decomposition
    Huginn's Gambit

    // continue if we've already shot an arrow
    Numerical Reflection: 0
    Inequality Distillation
    Conditional Continue

    // get targeted entity
    // could use sentinel walking here
    Mind's Reflection
    Compass' Purification
    Mind's Reflection
    Alidade's Purification
    Scout's Distillation

    // make sure target isn't null
    Gemini Decomposition
    Nullary Reflection
    Equality Distillation
    Conditional Continue

    // get living entity at target, make sure it's not me or null
    Compass' Purification
    Entity Purification: Living
    Gemini Decomposition
    Nullary Reflection
    Equality Distillation

    Prospector's Gambit
    Mind's Reflection
    Equality Distillation
    Disjunction Distillation
    Conditional Continue

    // shoot it real good
    Dioscuri Gambit
    Compass' Purification
    Jester's Gambit
    Compass' Purification II
    Subtractive Distillation
    
    Gemini Decomposition
    Length Purification
    Division Distillation
    
    Jester's Gambit
    Gemini Decomposition // optional: compensate for armor
    Nurse's Purification
    Numerical Reflection: 2 // with Power I: 3, II: 3.5, III: 4, IV: 4.5, V: 5
    Division Distillation
    Armor Compensator // optional: compensate for armor
    Multiplicative Distillation

    Prospector's Gambit
    Numerical Reflection: 0
    Prospector's Gambit
    Popularity Reflection
    Augur's Purification
    {
        Send Iota
        Bookkeeper's Gambit: vv
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit

    Pace Purification
    Subtractive Distillation
    Linear Impulse
}
Macros

Huginn's Gambit II
any
Sets a default value for the ravenmind.
eqqwawqaawaw

Code: Select all

#define Huginn's Gambit II (NORTH_WEST eqqwawqaawaw) = any ->
{
    Muninn's Reflection
    Gemini Decomposition
    Nullary Reflection
    Equality Distillation
    Rotation Gambit II
    Augur's Exaltation
    Huginn's Gambit
}
qqqqeewdweddwaadaadadddqddawddeqqwawqaaweee

Minimization Distillation
num, numnum
Returns the smaller of the inputs.
qaa

Code: Select all

#define Minimization Distillation (SOUTH_WEST qaa) = num, num -> num
{
    Dioscuri Gambit
    Minimus Distillation
    Rotation Gambit II
    Augur's Exaltation
}
qqqaadadaawqddqddawddeee
Last edited by [object Object] on Mon Jul 03, 2023 7:56 pm, edited 2 times in total.
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Smart Judgement

Post by [object Object] »

Smart Judgement
Macros: Conditional Charon, Linear Impulse, Armor Compensator (optional)

This hex kills your target.

More precisely, it teleports an arrow from a holding chamber to a point just above the head of the entity you're looking at (using Hexal's Gates), then impulses the arrow down at just the right speed to kill your target, taking into account its health and armor (though if you want to draw a few less patterns, you can leave out the armor part). If the arrow would be teleported into a block, it first breaks that block.

Use Locator's Scalpel to insert a Gate iota at the marked placeholder (Bookkeeper's Gambit: --). You'll need to insert the same Gate iota into the holding chamber hex, so save it somewhere convenient.

Note that this hex is more expensive (in terms of media) than the other railguns in this thread, because it only fires unenchanted arrows. There's also a 2.5 dust cost to teleport the arrow. Eventually, I plan to improve this by making another holding chamber that uses a skeleton to shoot Power V arrows. For now, if you want to save on media, I've also updated Smart Railgun II (above) to use Armor Compensator. Finally, if the target is wearing enchanted armour, this won't quite kill it. Maybe carry a sword?

Named after Dudblockman's unreleased Judgement hex.

Video demo
Patterns
qqqMind's ReflectionCompass' PurificationMind's ReflectionAlidade's PurificationScout's DistillationCompass' PurificationEntity Purification: LivingGemini DecompositionNullary ReflectionEquality DistillationProspector's GambitMind's ReflectionEquality DistillationDisjunction DistillationaqdeedGemini DecompositionCompass' Purification IIProspector's GambitStadiometer's PurificationNumerical Reflection: 0.5Additive DistillationVector Reflection +YMultiplicative Dstl.Additive DistillationNumerical Reflection: 4Gemini GambitVector Reflection -YArcher's DistillationJester's GambitFloor PurificationNumerical Reflection: 0.5Additive DistillationEquality DistillationqqqBreak BlockBookkeeper's Gambit: Drop 1eeeFlock's DisintegrationAugur's ExaltationHermes' GambitNumerical Reflection: 1Dioscuri GambitZone Distillation: Non-LivingRotation Gambit IIProspector's GambitqqqBookkeeper's Gambit: Keep 2eeeFlock's DisintegrationJester's GambitqqqwwqqqwqqawdedwZone Distillation: Non-LivingExclusionary DistillationNumerical Reflection: 0Selection DistillationJester's GambitGemini DecompositionaqwawqaNumerical Reflection: 2Division Dstl.wqqqqwwddVector Reflection -YMultiplicative Dstl.Prospector's GambitPace PurificationSubtractive Distillationawqqqwaqwweee

Code: Select all

// macros
#define Conditional Charon (SOUTH_WEST aqdeed) = bool ->
#define Linear Impulse (SOUTH_WEST awqqqwaqww) = entity, vector ->
#define Armor Compensator (NORTH_WEST wqqqqwwdd) = entity, num -> num

{
    // get target
    // could replace this with sentinel walking to get MUCH longer range
    Mind's Reflection
    Compass' Purification
    Mind's Reflection
    Alidade's Purification
    Scout's Distillation

    // get living entity at target, make sure it's not me or null
    // this ensures we're shooting something that's worth shooting
    Compass' Purification
    Entity Purification: Living
    Gemini Decomposition
    Nullary Reflection
    Equality Distillation

    Prospector's Gambit
    Mind's Reflection
    Equality Distillation
    Disjunction Distillation
    Conditional Charon

    // get desired arrow position
    Gemini Decomposition
    Compass' Purification II
    Prospector's Gambit
    Stadiometer's Purification
    Numerical Reflection: 0.5
    Additive Distillation

    Vector Reflection +Y
    Multiplicative Distillation
    Additive Distillation

    // break the block if it would hit something
    Numerical Reflection: 4
    Gemini Gambit
    Vector Reflection -Y
    Archer's Distillation

    Jester's Gambit
    Floor Purification
    Numerical Reflection: 0.5
    Additive Distillation
    Equality Distillation

    {
        Break Block
        Bookkeeper's Gambit: v
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit

    // get all non-living entities currently where the arrow will show up
    Numerical Reflection: 1
    Dioscuri Gambit
    Zone Distillation: Non-Living
    Rotation Gambit II
    
    // summon the arrow from the holding chamber
    Prospector's Gambit
    {
        Bookkeeper's Gambit: -- // gate iota placeholder
    }
    Flock's Disintegration
    Jester's Gambit
    Gate's Closing
    
    // select the arrow
    // should be the only entity in this zone and not the other
    // but only select the first one in case multiple arrows got marked somehow
    Zone Distillation: Non-Living
    Exclusionary Distillation
    Numerical Reflection: 0
    Selection Distillation
    
    // get the speed to kill the target
    Jester's Gambit
    Gemini Decomposition // optional: compensate for armor
    Nurse's Purification
    Numerical Reflection: 2 // with Power I: 3, II: 3.5, III: 4, IV: 4.5, V: 5
    Division Distillation
    Armor Compensator // optional: compensate for armor

    // cancel existing arrow velocity and shoot it real good
    Vector Reflection -Y
    Multiplicative Distillation
    Prospector's Gambit
    Pace Purification
    Subtractive Distillation
    Linear Impulse
}
Remote Quiver Wisp
Macros: Conditional Charon
Template: Permanent Wisp

This is the holding chamber for the above hex. It uses the Permanent Wisp template; use Locator's Scalpel to replace patterns in the template as per the comments in the code block below. Also use Locator's Scalpel to insert a Gate iota (must be the same one as above) at the marked placeholder (Bookkeeper's Gambit: --).

Build the chamber above the Permanent Wisp circle as shown below. To summon the wisp, run the completed hex while looking at the face of the lower observer. When you summon the wisp, there shouldn't be any arrows in the chamber. Avoid putting any non-living non-item entities within a 2-block radius of the centre of the bubble stream.
Holding Chamber
Image
Patterns
qqqGemini DecompositionCompass' PurificationVector Reflection +YNumerical Reflection: 3Multiplicative Dstl.Additive DistillationNumerical Reflection: 2Dioscuri GambitZone Distillation: Non-ItemRotation Gambit IIZone Distillation: Non-LivingIntersection DistillationGemini DecompositionAugur's PurificationqqqMuninn's ReflectionAugur's PurificationNegation PurificationaqdeedSpeaker's DecompositionqqqBookkeeper's Gambit: Keep 2eeeFlock's DisintegrationJester's GambitqaqeedeFalse ReflectionHuginn's GambiteeeqqqMuninn's ReflectionAugur's PurificationaqdeedProspector's GambitCompass' PurificationVector Reflection +YNumerical Reflection: 7Multiplicative Dstl.Additive DistillationGemini DecompositionConjure BlockBreak BlockTrue ReflectionHuginn's GambiteeeAugur's ExaltationHermes' GambitBookkeeper's Gambit: Drop 1eee

Code: Select all

// macros
#define Conditional Charon (SOUTH_WEST aqdeed) = bool ->

// replacement for Numerical Reflection: 10
// because you can easily use up ~7 media if you're firing while it's trying to refuel
Numerical Reflection: 25

// replacement for Reveal
{
    // zone distillation in the arrow chamber
    // this is probably in a reasonably controlled environment
    // so don't need to bother with the full stuck arrow detector
    Gemini Decomposition
    Compass' Purification
    Vector Reflection +Y
    Numerical Reflection: 3
    Multiplicative Distillation
    Additive Distillation
    Numerical Reflection: 2
    
    Dioscuri Gambit
    Zone Distillation: Non-Item
    Rotation Gambit II
    Zone Distillation: Non-Living
    Intersection Distillation
    
    // check if there's an arrow in the chamber
    // TODO: allow multiple arrows?
    // TODO: mark if unmarked, not if flag is true
    Gemini Decomposition
    Augur's Purification
    {
        // if there is an arrow, abort if we've already marked it
        Muninn's Reflection
        Augur's Purification
        Negation Purification
        Conditional Charon
        
        // mark the arrow
        Speaker's Decomposition
        {
            Bookkeeper's Gambit: -- // gate iota placeholder
        }
        Flock's Disintegration
        Jester's Gambit
        Gate's Opening
        
        // forget that we dispensed an arrow
        False Reflection
        Huginn's Gambit
    }
    {
        // if there isn't an arrow, abort if we've already dispensed one
        Muninn's Reflection
        Augur's Purification
        Conditional Charon
        
        // dispense an arrow
        Prospector's Gambit
        Compass' Purification
        Vector Reflection +Y
        Numerical Reflection: 7
        Multiplicative Distillation
        Additive Distillation
        
        Gemini Decomposition
        Conjure Block
        Break Block

        // remember that we dispensed an arrow
        True Reflection
        Huginn's Gambit
    }
    Augur's Exaltation
    Hermes' Gambit
    Bookkeeper's Gambit: v
}