------------------------- name = "Dorkus Maximus" description = "A dynaboss AI for a skeleton boss thingie yeah" scheduling-priority = high logging = enabled ------------------------- # Represents the hollow core of the snow cage const $`cage middle` <: set of coordinates = for { $x | -1..0 $y | 0..1 $z | -1..0 } → $x * < EAST > + $y * < UP > + $z * < SOUTH > # This is the snow cage (minus the hollow core specified above) const $`cage template` <: set of coordinates = ( for { $x | -2..1 $y | 0..2 $z | -2..1 } → $x * < EAST > + $y * < UP > + $z * < SOUTH > ) - $`cage middle` # Skelly boss const $self = first eager &entity ~ &living from context # Players in close proximity to the boss var $melees = each pure &player inside radius 15 about @self # Snow near the boss that gets melted var $impediments = each pure &fixture inside radius 3 about @self + < UP >, having it == &snow start cage every (chance of 40 .. 70 ) seconds start firing every (chance of 25 .. 65 ) seconds start arrowing every (chance of 10 .. 45 ) seconds start launching every (chance of 15 .. 30 ) seconds # Melt snow at random intervals near the boss despawn ($impediments having 35% chance) every 300 milliseconds # Shoot a barrage of arrows at all the players define arrowing { every 150 milliseconds do { let nil = spawn (chance of 2 .. 4) ⊗ lazy place at @self + < UP > * 2 mob &mmm:arrow with { orientation → (((@melees - @self) ⊗ < UP > * (chance of -5 .. 5)) -^ + (@melees - @self)) -^ shooter → @self critical → yes } play sound &random\explode at @self\location pitch 2.2 } stop this when (chance of 2 .. 5) seconds elapses } # Surround all the players in a cage of snow define cage { var $cage <: set of coordinates = for { $node | $`cage template` $sucker | $melees } → $node + $sucker var $selection <: set of coordinates = ∅ once when started then { # We want to remove blocks from the cage that occupy non-replaceable areas let $cage = $cage having not existing each &fixture at it, having not it\replaceable play sound &mob\blaze\breathe at @melees pitch 0.012 } # Incrementally spawn the cage block-by-block every 50 milliseconds do { let ($selection, $cage) = $cage -/- 34% chance let nil = spawn fix &snow, into $selection } } # Set the ground ablaze infront of each player define firing { var $`surrounding ground` = each eager &fixture inside radius 4 about @melees, having it\ground start placing when started define placing { # I just love linear algebra... compute a manifold of flames that is a projection upon the ground manifold and is in an area in-front of the target var $mapping <: set of <( coordinates; real; truth )> = for { ($meleeLoc, $dg) <: <( coordinates; coordinates )> | $`surrounding ground` ⇒ <( $melee\location; it - $melee )> $melee | @melees } → <( $dg + + $meleeLoc; |m| (($melee\orientation * 3 - (($melee\orientation * 3) * < UP >) * < UP >) - ($dg - ($dg * < UP >) * )); |m| (($melee\orientation * 3 - (($melee\orientation * 3) * < UP >) * < UP >) - ($dg - ($dg * < UP >) * )) < 1 )> var $placements <: set of coordinates = ($mapping having ($loc, $len, $valid) → $valid) ⇒ ($loc, $len, $valid) → $loc once when started then { play sound &fire\ignite at @melees let nil = spawn fix &fire, into $placements } } } # Teleport to a random player and then vault him/her high up into the sky define launching { # Only target players that are far away const $rangers = each eager &player inside radius 45 about @self, having |m| (it - @self) > 9 const $suckers = each lazy &player inside radius 1.5 about @self stop this when not existing @rangers # Look at the sucker orient @self to @rangers once when started # Here's the teleportation bit once when 150 milliseconds elapses then { do freeze @self move @self to @rangers + @rangers\orientation + < UP > play sound &mob\endermen\portal at @self\location pitch 0.8 } # Vault! once when 700 milliseconds elapses then { accelerate @suckers toward (@self\orientation + < UP >) * 2 play sound &mmm:mob\witch\hurt at @suckers pitch 0.4 play sound &random\explode at @suckers pitch 1.1 } stop this once when 2 seconds elapses } on exit do thaw @self