Files
jak-project/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

1772 lines
62 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: robo-hover.gc
;; name in dgo: robo-hover
;; dgos: SEA, FACC, FACD
;; DECOMP BEGINS
(defpartgroup group-robo-gun-smoke
:id 558
:duration (seconds 0.017)
:flags (sp0)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 2205 :flags (sp7)))
)
(defpart 2205
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 1.5)
(:scale-x (meters 0.5) (meters 0.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 64.0 64.0)
(:g :copy r)
(:b :copy g)
(:a 64.0)
(:vel-z (meters 0.006666667) (meters 0.006666667))
(:scalevel-x (meters 0.0033333334) (meters 0.004))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.026666667 -0.10666667)
(:accel-y (meters 0.0001) (meters 0.000033333334))
(:friction 0.98)
(:timer (seconds 2))
(:flags (sp-cpuinfo-flag-2))
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700))
(:rotate-y (degrees 0))
)
)
(defpartgroup group-robo-gun-casing
:id 559
:duration (seconds 0.017)
:flags (sp0)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 2206 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7))
(sp-item 2207 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7))
)
)
(defpart 2207
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 3.0)
(:scale-x (meters 0.5) (meters 0.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 0.0)
(:a 32.0)
(:vel-z (meters 0.006666667) (meters 0.006666667))
(:scalevel-x (meters 0.0033333334) (meters 0.004))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:scalevel-y :copy scalevel-x)
(:fade-r -2.56)
(:fade-g -2.56)
(:fade-b 2.56)
(:fade-a -0.32)
(:accel-y (meters 0.0001) (meters 0.000033333334))
(:friction 0.98)
(:timer (seconds 2))
(:flags (sp-cpuinfo-flag-2))
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700))
(:next-time (seconds 0.167))
(:next-launcher 2208)
(:rotate-y (degrees 0))
)
)
(defpart 2208
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667))
)
(defpart 2206
:init-specs ((:texture (motion-blur-part level-default-sprite))
(:num 1.0)
(:z (meters -0.4))
(:scale-x (meters 2.5))
(:rot-x 4)
(:scale-y (meters 0.15) (meters 0.02))
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 64.0 32.0)
(:omega (degrees 0.03375))
(:vel-z (meters 0.033333335) (meters 0.06666667))
(:fade-b -8.0)
(:accel-y (meters -0.0016666667) (meters -0.0016666667))
(:friction 0.9 0.04)
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:func 'sparticle-motion-blur)
(:next-time (seconds 0.05))
(:next-launcher 2209)
(:conerot-x (degrees -20) (degrees 40))
(:conerot-z (degrees 0) (degrees 360))
(:rotate-y (degrees 0))
)
)
(defpart 2209
:init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96))
)
(defpartgroup group-robo-engine
:id 560
:duration (seconds 0.017)
:flags (sp0 sp7)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 2210 :flags (is-3d sp7))
(sp-item 2211 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))
(sp-item 2212 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7))
(sp-item 2213 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7))
(sp-item 2214 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))
)
)
(defpart 2210
:init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite))
(:num 1.0)
(:y (meters 0))
(:z (meters 0.6) (meters 0.1))
(:scale-x (meters 0.6))
(:scale-y (meters 2.6))
(:r 128.0 128.0)
(:g 64.0 64.0)
(:b :copy g)
(:a 128.0 64.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:rotate-x (degrees -90))
(:rotate-y (degrees 0))
(:rotate-z (degrees 180))
)
)
(defpart 2214
:init-specs ((:texture (glow level-default-sprite))
(:num 1.0)
(:y (meters -0.3))
(:scale-x (meters 1.5) (meters 0.1))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 64.0 64.0)
(:b 0.0)
(:a 16.0 8.0)
(:omega (degrees 2718))
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 409.6)
)
)
(defpart 2211
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 0.5)
(:y (meters 0) (meters -0.25))
(:scale-x (meters 0.2) (meters 0.2))
(:rot-z (degrees 0) 1 (degrees 180))
(:scale-y (meters 1) (meters 0.6))
(:r 192.0)
(:g 64.0)
(:b 0.0)
(:a 0.0 16.0)
(:vel-y (meters -0.1) (meters -0.016666668))
(:scalevel-x (meters 0.033333335))
(:scalevel-y (meters 0.006666667))
(:fade-r -2.0)
(:fade-g 2.0)
(:fade-b 5.0)
(:fade-a 0.32)
(:accel-x (meters 0) (meters 0.0016666667))
(:accel-y (meters 0.00016666666) (meters 0.00033333333))
(:friction 0.94)
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z))
(:next-time (seconds 0.085))
(:next-launcher 2215)
(:rotate-y (degrees 0) (degrees 360))
)
)
(defpart 2215
:init-specs ((:r 64.0 64.0)
(:g 64.0 64.0)
(:b 64.0 64.0)
(:fade-r 0.0)
(:fade-g 0.0)
(:fade-b 0.0)
(:fade-a -0.064 -0.128)
)
)
(defpart 2212
:init-specs ((:texture (hotdot level-default-sprite))
(:num 0.1 0.1)
(:y (meters 0.25) (meters -0.5))
(:scale-x (meters 0.05))
(:scale-y (meters 0.5))
(:r 192.0 64.0)
(:g 0.0 128.0)
(:b 0.0)
(:a 128.0)
(:vel-y (meters -0.033333335) (meters -0.026666667))
(:scalevel-x (meters 0.001))
(:scalevel-y (meters -0.017))
(:fade-g 0.0)
(:accel-x (meters 0) (meters 0.0016666667))
(:accel-y (meters 0.00016666666) (meters 0.0005))
(:friction 0.96)
(:timer (seconds 0.167) (seconds 0.247))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z))
(:next-time (seconds 0.1))
(:next-launcher 2216)
(:rotate-y (degrees 0) (degrees 360))
)
)
(defpart 2216
:init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)))
)
(defpart 2213
:init-specs ((:num 1.0)
(:rot-x 8)
(:r 1638.4)
(:g 1331.2)
(:b 1433.6)
(:vel-y (meters -0.1) (meters -0.016666668))
(:fade-r 32.768)
(:fade-g 26.623999)
(:fade-b 28.671999)
(:accel-x (meters 0) (meters 0.0016666667))
(:friction 0.94)
(:timer (seconds 0.335))
(:flags (distort launch-along-z))
(:next-time (seconds 0.167))
(:next-launcher 2217)
(:rotate-y (degrees 0) (degrees 360))
)
)
(defpart 2217
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096))
)
(deftype robo-hover-shot (guard-shot)
()
)
(defmethod play-impact-sound ((this robo-hover-shot) (arg0 projectile-options))
(cond
((zero? arg0)
)
(else
((method-of-type guard-shot play-impact-sound) this arg0)
)
)
0
(none)
)
(deftype robo-hover (hover-enemy)
((wrist-quat quaternion 2 :inline)
(aim-position vector :inline)
(entity-group actor-group)
(smoke-part sparticle-launch-control)
(engine-part sparticle-launch-control)
(next-fire-time time-frame)
(gun-blend float)
(path-u float)
(path-du float)
(path-du-final float)
(path-dest float)
(sound-id sound-id)
(knocked-recover-anim int32)
(attack-wait-min float)
(attack-wait-max float)
(attack-miss-dist-min float)
(attack-miss-dist-max float)
(attack-miss-dist-curr float)
(shots-fired int32)
)
(:state-methods
ambush-fly
ambush-attack
kick-attack
attack
explode
)
(:methods
(spawn-shot-from-cspace-idx (_type_ vector projectile-init-by-other-params int float) none)
(should-attack? (_type_ process-focusable) symbol)
)
)
(defskelgroup skel-robo-hover robo-hover robo-hover-lod0-jg -1
((robo-hover-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 7.5)
:origin-joint-index 3
)
(define *fact-info-robo-hover-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80)))
(define *robo-hover-enemy-info*
(new 'static 'enemy-info
:use-die-falling #t
:use-victory #f
:use-jump-blocked #f
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #f
:hover-if-no-ground #f
:idle-anim-script (new 'static 'inline-array idle-control-frame 3
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
(new 'static 'idle-control-frame
:command (idle-control-cmd play)
:anim #x2
:param0 100
:param1 100
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
)
(new 'static 'idle-control-frame)
)
:idle-anim 2
:notice-anim 2
:hostile-anim 2
:hit-anim -1
:knocked-anim -1
:knocked-land-anim -1
:die-anim 2
:die-falling-anim 2
:victory-anim 2
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint 6
:look-at-joint 6
:bullseye-joint 4
:sound-hit (static-sound-name "hover-take-hit")
:sound-die (static-sound-name "hover-explode")
:notice-distance (meters 70)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 55)
:default-hit-points 4.0
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:knocked-can-land-timeout (seconds 0.1)
:knocked-recover-timeout (seconds 2)
:ragdoll-blend-out-time (seconds 0.75)
:ragdoll-rotate-velocity-mult 1.0
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 2730.6667
:knocked-soft-vxz-lo (meters 17.6)
:knocked-soft-vxz-hi (meters 26.4)
:knocked-soft-vy-lo (meters 20)
:knocked-soft-vy-hi (meters 30)
:knocked-medium-vxz-lo (meters 36)
:knocked-medium-vxz-hi (meters 48)
:knocked-medium-vy-lo (meters 33)
:knocked-medium-vy-hi (meters 37)
:knocked-hard-vxz-lo (meters 19.2)
:knocked-hard-vxz-hi (meters 28.8)
:knocked-hard-vy-lo (meters 44.8)
:knocked-hard-vy-hi (meters 51.2)
:knocked-huge-vxz-lo (meters 40.2)
:knocked-huge-vxz-hi (meters 60.8)
:knocked-huge-vy-lo (meters 44.8)
:knocked-huge-vy-hi (meters 53.2)
:knocked-yellow-vxz-lo (meters 10)
:knocked-yellow-vxz-hi (meters 12)
:knocked-yellow-vy-lo (meters 14)
:knocked-yellow-vy-hi (meters 20)
:knocked-red-vxz-lo (meters 6)
:knocked-red-vxz-hi (meters 48)
:knocked-red-vy-lo (meters 23)
:knocked-red-vy-hi (meters 37)
:knocked-blue-vxz-lo (meters 10)
:knocked-blue-vxz-hi (meters 12)
:knocked-blue-vy-lo (meters 6)
:knocked-blue-vy-hi (meters 20)
:ragdoll-info (new 'static 'ragdoll-setup
:orient-tform (new 'static 'vector :x 0.135 :y 0.9566 :z 0.258 :w 1296.2657)
:scale (new 'static 'vector :x 1.3 :y 1.3 :z 1.3)
:bg-collide-with (collide-spec backgnd obstacle hit-by-others-list player-list)
:joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup
(new 'static 'ragdoll-joint-setup
:joint-index 3
:parent-joint -1
:geo-tform (new 'static 'vector :y 0.97 :z -0.2424)
:axial-slop 1956.2314
:coll-rad 2563.2769
)
(new 'static 'ragdoll-joint-setup
:joint-index 4
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.9137 :z 0.4059 :w 128.2139)
:geo-tform (new 'static 'vector :x -0.6215 :y 0.4424 :z 0.6463 :w 1523.257)
:axial-slop 1956.2314
:coll-rad 3069.1328
)
(new 'static 'ragdoll-joint-setup
:joint-index 5
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.6945 :z 0.7192 :w 1398.9205)
:geo-tform (new 'static 'vector :x 0.9993 :y 0.0004 :z -0.0321 :w 32764.305)
:axial-slop 1956.2314
:max-angle 582.8335
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 9
:parent-joint 4
:pre-tform (new 'static 'vector :x -0.0339 :z -0.9993 :w 15408.26)
:geo-tform (new 'static 'vector :x -0.5383 :y 0.1414 :z -0.8306 :w 16726.791)
:axial-slop 1956.2314
:max-angle 4626.6777
:coll-rad 1919.7952
)
(new 'static 'ragdoll-joint-setup
:joint-index 10
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.5267 :z -0.8498 :w 15854.014)
:geo-tform (new 'static 'vector :x 0.9471 :y 0.0458 :z -0.317 :w 8343.953)
:axial-slop 1956.2314
:max-angle 4592.1987
:coll-rad 2034.0736
)
(new 'static 'ragdoll-joint-setup
:joint-index 11
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.8737 :z -0.4861 :w 8443.986)
:geo-tform (new 'static 'vector :x 0.0707 :y -0.0016 :z 0.9973 :w 32077.27)
:axial-slop 1956.2314
:max-angle 3978.5269
:coll-rad 1650.2784
)
(new 'static 'ragdoll-joint-setup
:joint-index 13
:parent-joint 4
:pre-tform (new 'static 'vector :x 0.0977 :z 0.9951 :w 17489.209)
:geo-tform (new 'static 'vector :x -0.4605 :y -0.1731 :z 0.8704 :w 14589.733)
:axial-slop 1956.2314
:max-angle 4570.1714
:coll-rad 1776.4352
)
(new 'static 'ragdoll-joint-setup
:joint-index 14
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.4392 :z 0.8982 :w 13901.897)
:geo-tform (new 'static 'vector :x 0.948 :y -0.0684 :z 0.3102 :w 8417.535)
:axial-slop 1956.2314
:max-angle 4647.9585
:coll-rad 1761.28
)
(new 'static 'ragdoll-joint-setup
:joint-index 15
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.8737 :z 0.4861 :w 8511.816)
:geo-tform (new 'static 'vector :x -0.0619 :y -0.0024 :z 0.9979 :w 33469.145)
:axial-slop 1956.2314
:max-angle 3978.5269
:coll-rad 941.6704
)
(new 'static 'ragdoll-joint-setup
:joint-index 17
:parent-joint 4
:pre-tform (new 'static 'vector :x -0.6039 :z 0.7969 :w 13667.241)
:geo-tform (new 'static 'vector :x 0.8895 :y -0.0116 :z 0.4563 :w 26744.166)
:axial-slop 1956.2314
:max-angle 1669.9482
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 18
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.8038 :z -0.5946 :w 5249.47)
:geo-tform (new 'static 'vector :x 0.5202 :y 0.7875 :z 0.3301 :w 26617.41)
:axial-slop 1956.2314
:max-angle 2902.4075
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 20
:parent-joint 4
:pre-tform (new 'static 'vector :x -0.729 :z -0.6842 :w 12270.943)
:geo-tform (new 'static 'vector :x -0.562 :y 0.8215 :z -0.0938 :w 11583.488)
:axial-slop 1956.2314
:max-angle 2017.1434
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 21
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.9241 :z 0.3817 :w 5283.221)
:geo-tform (new 'static 'vector :x -0.457 :y 0.3018 :z -0.8365 :w 20530.607)
:axial-slop 1956.2314
:max-angle 2715.2292
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 23
:parent-joint 3
:pre-tform (new 'static 'vector :x 0.9137 :z -0.4059 :w 32640.186)
:geo-tform (new 'static 'vector :x -0.1154 :y 0.9491 :z -0.2924 :w 9130.13)
:axial-slop 1956.2314
:coll-rad 2801.664
)
(new 'static 'ragdoll-joint-setup
:joint-index 25
:parent-joint 23
:pre-tform (new 'static 'vector :x -0.9007 :z -0.434 :w 18955.432)
:geo-tform (new 'static 'vector :x 0.7264 :y 0.4661 :z 0.5046 :w 25302.322)
:axial-slop 1956.2314
:max-angle 3748.0403
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 26
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.9715 :z -0.2362 :w 20283.174)
:geo-tform (new 'static 'vector :x 0.5131 :y -0.7386 :z 0.4366 :w 17948.018)
:axial-slop 1956.2314
:max-angle 3769.3032
:coll-rad 1829.6832
)
(new 'static 'ragdoll-joint-setup
:joint-index 27
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.1509 :z 0.9884 :w 11051.208)
:geo-tform (new 'static 'vector :x 0.6368 :y -0.4494 :z -0.6262 :w 39951.562)
:axial-slop 1956.2314
:max-angle 3456.6052
:coll-rad 2770.944
)
(new 'static 'ragdoll-joint-setup
:joint-index 28
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.3213 :z -0.9468 :w 3896.716)
:geo-tform (new 'static 'vector :x -0.6668 :y 0.2851 :z 0.6881 :w 27198.15)
:axial-slop 1956.2314
:max-angle 2881.8545
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 29
:parent-joint 27
:pre-tform (new 'static 'vector :x -0.1253 :z -0.992 :w 10519.748)
:geo-tform (new 'static 'vector :x -0.0665 :y -0.9952 :z -0.0692 :w 16487.02)
:axial-slop 1956.2314
:max-angle 3978.5269
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 31
:parent-joint 23
:pre-tform (new 'static 'vector :x 0.5228 :z 0.8522 :w 13813.332)
:geo-tform (new 'static 'vector :x 0.2339 :y 0.0702 :z -0.9696 :w 16575.53)
:axial-slop 1956.2314
:max-angle 2779.0723
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 32
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.1173 :z -0.9929 :w 16395.104)
:geo-tform (new 'static 'vector :x -0.0509 :y 0.8568 :z -0.5128 :w 34475.977)
:axial-slop 1956.2314
:max-angle 3910.242
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 33
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.9812 :z 0.1919 :w 11140.046)
:geo-tform (new 'static 'vector :x 0.9718 :y -0.1746 :z -0.1571 :w 42936.312)
:axial-slop 1956.2314
:max-angle 3790.584
:coll-rad 2873.7537
)
(new 'static 'ragdoll-joint-setup
:joint-index 34
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.6499 :z -0.7598 :w 2936.2312)
:geo-tform (new 'static 'vector :x 0.979 :y -0.0795 :z -0.1866 :w 40687.844)
:axial-slop 1956.2314
:max-angle 2122.1104
:coll-rad 2148.7617
)
(new 'static 'ragdoll-joint-setup
:joint-index 35
:parent-joint 33
:pre-tform (new 'static 'vector :x 0.8818 :z -0.4711 :w 9404.999)
:geo-tform (new 'static 'vector :x 0.0161 :y 0.9977 :z 0.0637 :w 36161.0)
:axial-slop 1956.2314
:max-angle 3978.5269
:coll-rad 2148.7617
)
)
)
:shadow-size (meters 2)
:shadow-max-y (meters 10)
:shadow-min-y (meters -20)
:shadow-locus-dist (meters 150)
:gem-joint -1
:gem-offset (new 'static 'sphere :r 163840.0)
:knocked-off #t
)
)
(set! (-> *robo-hover-enemy-info* fact-defaults) *fact-info-robo-hover-defaults*)
(define *robo-hover-debris-params*
(new 'static 'debris-static-params
:joints (new 'static 'boxed-array :type debris-static-joint-params
(new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-b")
(new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-c")
(new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-d")
(new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-kg-debris-b")
(new 'static 'debris-static-joint-params :parent-joint-index 17 :group "skel-kg-debris-c")
(new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-kg-debris-d")
(new 'static 'debris-static-joint-params :parent-joint-index 23 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 26 :group "skel-kg-debris-b")
(new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-kg-debris-c")
(new 'static 'debris-static-joint-params :parent-joint-index 32 :group "skel-kg-debris-d")
(new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-b")
(new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-c")
(new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-kg-debris-d")
(new 'static 'debris-static-joint-params :parent-joint-index 24 :group "skel-kg-debris-a")
(new 'static 'debris-static-joint-params :parent-joint-index 29 :group "skel-kg-debris-b")
(new 'static 'debris-static-joint-params :parent-joint-index 30 :group "skel-kg-debris-c")
(new 'static 'debris-static-joint-params :parent-joint-index 35 :group "skel-kg-debris-d")
)
:collide-spec (collide-spec backgnd)
:sound-hit (static-sound-name "kg-debris")
)
)
;; WARN: Return type mismatch int vs sound-id.
(defmethod play-damage-or-death-sound ((this robo-hover) (arg0 int))
"Pick and play the damage/death sound."
(if (and (zero? arg0) (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using)))
(sound-play "hover-take-hit")
(call-parent-method this arg0)
)
(the-as sound-id 0)
)
;; WARN: Return type mismatch object vs symbol.
(defbehavior exit-ambush? robo-hover ()
(the-as symbol (when (hover-enemy-method-160 self)
(hover-enemy-method-161 self)
(go-virtual hostile)
)
)
)
(defstate ambush (robo-hover)
:virtual #t
:enter (behavior ()
(when (or (zero? (-> self path)) (logtest? (-> self path flags) (path-control-flag not-found)))
(logior! (-> self enemy-flags) (enemy-flag alert))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(hover-enemy-method-159 self #f)
(hover-enemy-method-161 self)
(go-virtual hostile)
)
(let ((t9-3 (-> (method-of-type hover-enemy ambush) enter)))
(if t9-3
(t9-3)
)
)
)
)
(defstate ambush-fly (robo-hover)
:virtual #t
:event enemy-event-handler
:trans (behavior ()
(exit-ambush?)
(let ((a1-0 (handle->process (-> self focus handle))))
(when a1-0
(if (should-attack? self (the-as process-focusable a1-0))
(go-virtual ambush-attack)
)
)
)
)
:code hover-enemy-fly-code
:post (-> (method-of-type hover-enemy ambush) post)
)
(defstate ambush-attack (robo-hover)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('event-attack)
(when (< (-> self shots-fired) 2)
(let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))
(gp-0 (-> self focus-pos))
)
(set! (-> s5-0 ent) (-> self entity))
(set! (-> s5-0 charge) 1.0)
(set! (-> s5-0 options) (projectile-options))
(logclear! (-> s5-0 options) (projectile-options po14 po15 po16))
(set! (-> s5-0 notify-handle) (the-as handle #f))
(set! (-> s5-0 owner-handle) (the-as handle #f))
(set! (-> s5-0 target-handle) (the-as handle #f))
(set! (-> s5-0 target-pos quad) (the-as uint128 0))
(set! (-> s5-0 ignore-handle) (process->handle self))
(let* ((v1-10 *game-info*)
(a0-7 (+ (-> v1-10 attack-id) 1))
)
(set! (-> v1-10 attack-id) a0-7)
(set! (-> s5-0 attack-id) a0-7)
)
(set! (-> s5-0 timeout) (seconds 4))
(spawn-shot-from-cspace-idx self gp-0 s5-0 11 -1.0)
(spawn-shot-from-cspace-idx self gp-0 s5-0 15 -1.0)
)
(sound-play "hover-fire")
(let ((v0-0 (the-as object (+ (-> self shots-fired) 1))))
(set! (-> self shots-fired) (the-as int v0-0))
v0-0
)
)
)
(else
(enemy-event-handler proc argc message block)
)
)
)
:enter (behavior ()
(set-time! (-> self state-time))
(set! (-> self shots-fired) 0)
0
)
:exit (behavior ()
(set-time! (-> self next-fire-time))
(set! (-> self restart-fly-anims) #t)
)
:trans (behavior ()
(exit-ambush?)
(if (or (los-control-method-11 (-> self los) (seconds 0.2))
(not (pointing-toward? self (-> self focus-pos) 9102.223))
)
(go-virtual ambush-fly)
)
)
:code (behavior ()
(sound-play "hover-warn")
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self hover-info shoot-anim))
:num! (seek!)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-virtual ambush-fly)
)
:post (behavior ()
((the-as (function none) (-> (method-of-type hover-enemy ambush) post)))
)
)
(defstate notice (robo-hover)
:virtual #t
:post (behavior ()
(let ((t9-0 (-> (method-of-type hover-enemy notice) post)))
(if t9-0
((the-as (function none) t9-0))
)
)
(talker-spawn-func (-> *talker-speech* 7) *entity-pool* (target-pos 0) (the-as region #f))
(set-time! (-> self next-fire-time))
)
)
(defstate hostile (robo-hover)
:virtual #t
:trans (behavior ()
(let ((t9-0 (-> (method-of-type hover-enemy hostile) trans)))
(if t9-0
(t9-0)
)
)
(when (< (vector-vector-distance (-> self root trans) (-> self focus-pos)) 450560.0)
(if (should-attack? self (the-as process-focusable #f))
(go-virtual attack)
)
)
)
:post (behavior ()
(let ((t9-0 (-> (method-of-type hover-enemy hostile) post)))
(if t9-0
((the-as (function none) t9-0))
)
)
(set! (-> self gun-blend)
(seek-ease (-> self gun-blend) 0.0 (* 4.0 (seconds-per-frame)) 0.1 (* 0.1 (seconds-per-frame)))
)
)
)
(defstate kick-attack (robo-hover)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
)
:trans (behavior ()
(if (time-elapsed? (-> self state-time) (seconds 4))
(go-hostile self)
)
)
:code hover-enemy-fly-code
:post (behavior ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'get-formation)
(let ((t9-0 send-event-function)
(v1-2 (-> self formation-entity))
)
(t9-0
(if v1-2
(-> v1-2 extra process)
)
a1-0
)
)
)
(let ((gp-0 (-> self dest-pos)))
(let ((a0-6 (as-type (handle->process (-> self focus handle)) process-focusable)))
(vector-copy! gp-0 (get-trans (the-as process-focusable a0-6) 0))
)
(+! (-> gp-0 y) -20480.0)
(hover-nav-control-method-12 (-> self hover) gp-0)
)
(hover-enemy-dest-post)
)
)
(defstate attack (robo-hover)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(case message
(('event-attack-l)
(let ((a2-1 (new 'stack-no-clear 'projectile-init-by-other-params))
(a1-1 (-> self focus-pos))
)
(set! (-> a2-1 ent) (-> self entity))
(set! (-> a2-1 charge) 1.0)
(set! (-> a2-1 options) (projectile-options))
(logclear! (-> a2-1 options) (projectile-options po14 po15 po16))
(set! (-> a2-1 notify-handle) (the-as handle #f))
(set! (-> a2-1 owner-handle) (the-as handle #f))
(set! (-> a2-1 target-handle) (the-as handle #f))
(set! (-> a2-1 target-pos quad) (the-as uint128 0))
(set! (-> a2-1 ignore-handle) (process->handle self))
(let* ((v1-9 *game-info*)
(a0-7 (+ (-> v1-9 attack-id) 1))
)
(set! (-> v1-9 attack-id) a0-7)
(set! (-> a2-1 attack-id) a0-7)
)
(set! (-> a2-1 timeout) (seconds 4))
(spawn-shot-from-cspace-idx self a1-1 a2-1 11 -1.0)
)
(sound-play "hover-fire")
(set! v0-3 (+ (-> self shots-fired) 1))
(set! (-> self shots-fired) (the-as int v0-3))
v0-3
)
(('event-attack-r)
(let ((a2-3 (new 'stack-no-clear 'projectile-init-by-other-params))
(a1-3 (-> self focus-pos))
)
(set! (-> a2-3 ent) (-> self entity))
(set! (-> a2-3 charge) 1.0)
(set! (-> a2-3 options) (projectile-options))
(logclear! (-> a2-3 options) (projectile-options po14 po15 po16))
(set! (-> a2-3 notify-handle) (the-as handle #f))
(set! (-> a2-3 owner-handle) (the-as handle #f))
(set! (-> a2-3 target-handle) (the-as handle #f))
(set! (-> a2-3 target-pos quad) (the-as uint128 0))
(set! (-> a2-3 ignore-handle) (process->handle self))
(let* ((v1-23 *game-info*)
(a0-17 (+ (-> v1-23 attack-id) 1))
)
(set! (-> v1-23 attack-id) a0-17)
(set! (-> a2-3 attack-id) a0-17)
)
(set! (-> a2-3 timeout) (seconds 4))
(spawn-shot-from-cspace-idx self a1-3 a2-3 15 1.0)
)
(sound-play "hover-fire")
(set! v0-3 (+ (-> self shots-fired) 1))
(set! (-> self shots-fired) (the-as int v0-3))
v0-3
)
(else
(enemy-event-handler proc argc message block)
)
)
)
:enter (behavior ()
(set-time! (-> self state-time))
(set! (-> self attack-miss-dist-curr)
(rnd-float-range self (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))
)
(set! (-> self shots-fired) 0)
0
)
:exit (behavior ()
(set! (-> self next-fire-time)
(+ (current-time)
(the int (* 300.0 (rnd-float-range self (-> self attack-wait-min) (-> self attack-wait-max))))
)
)
(set! (-> self restart-fly-anims) #t)
)
:trans (behavior ()
(if (or (los-control-method-11 (-> self los) (seconds 0.2))
(not (pointing-toward? self (-> self focus-pos) 9102.223))
)
(go-hostile self)
)
)
:code (behavior ()
(sound-play "hover-warn")
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self hover-info shoot-anim))
:num! (seek!)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-hostile self)
)
:post (behavior ()
(set! (-> self gun-blend)
(seek-ease (-> self gun-blend) 1.0 (* 3.0 (seconds-per-frame)) 0.9 (* 0.4 (seconds-per-frame)))
)
(vector-copy! (-> self aim-position) (-> self focus-pos))
(set! (-> self aim-position y) (+ 6144.0 (-> self attack-miss-dist-curr) (-> self aim-position y)))
(hover-enemy-hostile-post)
)
)
(defstate knocked (robo-hover)
:virtual #t
:trans (behavior ()
(-> self root)
(when (and (!= (-> self hit-points) 0.0) (time-elapsed? (-> self state-time) (seconds 0.2)))
(if (zero? (-> self fated-time))
(go-virtual knocked-recover)
(go-virtual explode)
)
)
)
:post (behavior ()
(call-parent-state-handler post)
(seek! (-> self gun-blend) 0.0 (* 5.0 (seconds-per-frame)))
)
)
(defstate knocked-recover (robo-hover)
:virtual #t
:exit (behavior ()
(let ((t9-0 (-> (method-of-type hover-enemy knocked-recover) exit)))
(if t9-0
(t9-0)
)
)
(set-time! (-> self next-fire-time))
)
:code (behavior ()
(local-vars (v1-31 symbol) (v1-56 symbol))
(cond
((handle->process (-> self ragdoll-proc))
(ja-channel-push! 1 0)
(ja-no-eval :group! robo-hover-idle-ja :num! (seek!) :frame-num 0.0)
(enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self)
(until v1-31
(suspend)
(ja :num! (seek!))
(set! v1-31 (and (ja-done? 0) (not (handle->process (-> self ragdoll-proc)))))
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (loop!) :frame-num 0.0)
(until v1-56
(suspend)
(ja :num! (loop!))
(set! v1-56 (and (logtest? (-> self root status) (collide-status on-surface))
(< (vector-length (-> self root transv)) 2048.0)
)
)
)
)
)
(if (out-of-bounds? self)
(go-die self)
(go-hostile self)
)
)
)
(defstate explode (robo-hover)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((v1-1 (-> self root root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(logior! (-> self draw status) (draw-control-status no-draw))
(sound-stop (-> self sound-id))
(sound-play "hover-explode")
(send-event self 'death-start)
(let ((a1-3 (new 'stack 'debris-tuning (the-as uint 1))))
(set! (-> a1-3 hit-xz-reaction) 0.95)
(set! (-> a1-3 hit-y-reaction) 0.6)
(vector-copy! (-> a1-3 fountain-rand-transv-lo) (-> self incoming attack-position))
(debris-spawn self a1-3 *robo-hover-debris-params* (the-as process-drawable #f))
)
(let ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node robo-hover-lod0-jg chest))))
(cond
((logtest? (-> group-kg-explosion flags) (sp-group-flag sp13))
(vector-copy! (-> *launch-matrix* trans) v1-16)
(part-tracker-spawn part-tracker-subsampler :to self :group group-kg-explosion)
)
(else
(vector-copy! (-> *launch-matrix* trans) v1-16)
(part-tracker-spawn part-tracker :to self :group group-kg-explosion)
)
)
)
)
:trans (behavior ()
(when (not (-> self child))
(cleanup-for-death self)
(deactivate self)
)
)
:code sleep-code
)
(defmethod get-inv-mass ((this robo-hover))
2.0
)
(defmethod event-handler ((this robo-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Commmon handler for events."
(local-vars (v1-15 enemy-flag))
(case arg2
(('attack-invinc)
(case (-> (the-as attack-info (-> arg3 param 1)) mode)
(('endlessfall)
#f
)
)
)
(('hit 'hit-flinch 'hit-knocked)
(speech-control-method-14 *speech-control* (the-as handle this))
(when (and (-> this next-state) (let ((v1-8 (-> this next-state name)))
(or (= v1-8 'ambush-fly) (= v1-8 'ambush-attack))
)
)
(hover-nav-control-method-19 (-> this hover))
(hover-enemy-method-159 this #t)
(let ((v1-14 (-> this enemy-flags)))
(if (logtest? v1-14 (enemy-flag vulnerable-backup))
(set! v1-15 (logior v1-14 (enemy-flag vulnerable)))
(set! v1-15 (logclear v1-14 (enemy-flag vulnerable)))
)
)
(set! (-> this enemy-flags) v1-15)
(hover-enemy-method-174 this)
)
(if (= (-> this hit-points) 0.0)
(go (method-of-object this explode))
(call-parent-method this arg0 arg1 arg2 arg3)
)
)
(('notify)
(let ((a0-20 (-> arg3 param 0))
(v1-20 (the-as object (-> arg3 param 1)))
)
(when (= a0-20 'attack)
(when (logtest? (the-as int (-> (the-as attack-info v1-20) trans y)) #x8000)
)
)
)
(call-parent-method this arg0 arg1 arg2 arg3)
)
(('impact-impulse)
(let ((v1-23 (the-as object (-> arg3 param 0))))
(when (< 4096.0 (-> (the-as rigid-body-impact v1-23) impulse))
(logior! (-> this root penetrated-by) (penetrate vehicle))
(set! (-> this hit-points) 0.0)
(go (method-of-object this explode))
#t
)
)
)
(else
(call-parent-method this arg0 arg1 arg2 arg3)
)
)
)
;; WARN: Return type mismatch object vs symbol.
(defmethod should-attack? ((this robo-hover) (arg0 process-focusable))
(let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv)))
(s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this focus-pos)))
(f30-0 (vector-length s5-1))
(a0-4 (if arg0
arg0
(handle->process (-> this focus handle))
)
)
)
(the-as
symbol
(when a0-4
(let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable a0-4) 0)))
(s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 1.0))
)
(and (< 0.0 (vector-dot s4-1 s5-2)) (and (< (-> this next-fire-time) (current-time))
(get-focus! this)
(< f30-0 225280.0)
(and (< (fabs (vector-x-angle s5-2)) 3640.889)
(pointing-toward? this (-> this focus-pos) 5461.3335)
(should-check-los? (-> this los) (seconds 0.4))
)
)
)
)
)
)
)
)
(defmethod play-fly-anim ((this robo-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int))
(local-vars (v1-1 int))
0
(if (< 0.0 arg1)
(set! v1-1 arg2)
(set! v1-1 arg3)
)
(let* ((f0-2 (- 1.0 arg1))
(a2-2 (- 1.0 (* (square f0-2) f0-2)))
(a3-7 (-> this skel root-channel arg0))
)
(let ((f0-6 (fabs a2-2)))
(set! (-> a3-7 frame-interp 1) f0-6)
(set! (-> a3-7 frame-interp 0) f0-6)
)
(set! (-> a3-7 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1)))
(set! (-> a3-7 param 0) 0.0)
(set! (-> a3-7 frame-num) (-> this skel root-channel 0 frame-num))
(joint-control-channel-group! a3-7 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan)
)
(none)
)
(defmethod knocked-handler ((this robo-hover) (arg0 vector))
"Called when this enemy is knocked."
(let ((s4-0 (-> this root)))
(case (-> this incoming knocked-type)
(((knocked-type explode-or-darkjak))
(let ((gp-1 (-> this root transv)))
(let ((a1-1 (handle->process (-> this incoming attacker-handle))))
(if a1-1
(vector-! gp-1 (-> (the-as process-drawable a1-1) root trans) (-> this root trans))
(vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans))
)
)
(set! (-> gp-1 y) 0.0)
(vector-normalize! gp-1 1.0)
(vector-rotate90-around-y! gp-1 gp-1)
(if (< 0.0 (vector-dot
(vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans))
(vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat))
)
)
(vector-negate! gp-1 gp-1)
)
(let ((f30-1 (rnd-float-range this 0.0 1.0))
(s5-1 (-> this enemy-info))
)
(vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1))
(set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1))
)
)
)
(else
(call-parent-method this arg0)
)
)
)
)
(defmethod hover-enemy-method-162 ((this robo-hover) (arg0 float))
(let ((f0-1 (* (-> this scale) arg0))
(v0-0 (-> this root scale))
)
(set! (-> v0-0 x) f0-1)
(set! (-> v0-0 y) f0-1)
(set! (-> v0-0 z) f0-1)
(set! (-> v0-0 w) 1.0)
v0-0
)
)
(defmethod enemy-common-post ((this robo-hover))
"Common implementation of post. Runs ja-post."
((method-of-type hover-enemy enemy-common-post) this)
0
(none)
)
(defmethod hover-enemy-method-163 ((this robo-hover))
(let ((s4-0 (-> this main-joint-movement 1))
(s5-0 (-> this main-joint-movement 2))
(gp-0
(lambda ((arg0 robo-hover) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int))
(let ((sv-192 arg2)
(s0-0 arg3)
(sv-224 arg4)
(s1-0 arg5)
(s3-0 arg6)
(s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg1))
(s5-0 (new 'stack-no-clear 'matrix))
(a1-3 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> arg1 bone transform)))
(sv-208 (new 'stack-no-clear 'vector))
(s2-1 (new 'stack-no-clear 'vector))
)
(-> arg0 scale)
(quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192)
(quaternion->matrix s5-0 (the-as quaternion sv-208))
(vector-copy! s2-1 (-> arg0 root scale))
(scale-matrix! s5-0 s2-1 s5-0)
(let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat)))
(v0-6 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) sv-224 (-> arg0 root quat)))
(f30-0 (* 1146880.0 (seconds-per-frame)))
(f28-0
(seek
(-> arg0 thrust s3-0)
(+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0)))
(fmax 0.0 (-> v0-6 y))
(fabs (/ (-> v0-6 z) 5))
(fmax 0.0 (-> s1-1 y))
)
(/ f30-0 5)
)
)
)
(let ((f20-0 (lerp-scale 819.2 4096.0 f28-0 1638.4 f30-0))
(f26-0 (lerp-scale 4915.2 15564.8 f28-0 1638.4 f30-0))
(f22-0 (lerp-scale 0.5 1.5 f28-0 1638.4 f30-0))
(f24-0 (lerp-scale 0.1 1.0 f28-0 1638.4 f30-0))
)
(lerp-scale 0.1 1.0 f28-0 1638.4 f30-0)
(let ((f1-10 (lerp-scale 0.02 0.6 f28-0 1638.4 f30-0))
(f2-6 (fmin 1.0 (-> s2-1 x)))
(f0-14 (fmin 1.0 (-> s2-1 y)))
)
(set! (-> *part-id-table* 2210 init-specs 4 initial-valuef) (* f20-0 f2-6))
(set! (-> *part-id-table* 2210 init-specs 5 initial-valuef) (* f26-0 f0-14))
(set! (-> *part-id-table* 2214 init-specs 3 initial-valuef) (* f22-0 f2-6))
(set! (-> *part-id-table* 2211 init-specs 1 initial-valuef) (* f24-0 f0-14))
(set! (-> *part-id-table* 2212 init-specs 1 initial-valuef) (* f1-10 f0-14))
(set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) (* f24-0 f0-14))
(set! (-> arg0 thrust s3-0) f28-0)
(let ((f0-15 (* f26-0 f0-14)))
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-15 -2))
)
)
)
(vector-copy! (-> s5-0 trans) s4-0)
(spawn-from-mat (-> arg0 engine-part) s5-0)
(let ((f0-17 (lerp-scale 0.4 1.0 f28-0 1638.4 f30-0)))
(sound-play-by-name
(static-sound-name "hover-jets")
(-> arg0 sound-id)
(the int (* 1024.0 f0-17))
0
0
(sound-group)
#t
)
)
)
)
0
)
)
)
(gp-0
this
(-> this node-list data (-> this hover-info engine-left))
(-> this hover-info thrust-rotate-left)
-1.0
s5-0
s4-0
0
)
(gp-0
this
(-> this node-list data (-> this hover-info engine-right))
(-> this hover-info thrust-rotate-right)
1.0
s5-0
s4-0
1
)
)
0
(none)
)
(defmethod hover-enemy-method-164 ((this robo-hover) (arg0 int) (arg1 float))
(let* ((s2-0 (-> this node-list data arg0))
(s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s2-0))
(s5-0 (new 'stack-no-clear 'matrix))
)
(let ((a1-3 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> s2-0 bone transform)))
(s2-1 (new 'stack-no-clear 'quaternion))
)
(quaternion-rotate-local-z! s2-1 a1-3 arg1)
(quaternion->matrix s5-0 s2-1)
)
(let ((f4-0 6144.0)
(f0-0 17203.2)
)
(let ((f3-0 2.0)
(f1-0 1.5)
)
1.5
(let ((f2-1 1.0))
(set! (-> *part-id-table* 2210 init-specs 4 initial-valuef) f4-0)
(set! (-> *part-id-table* 2210 init-specs 5 initial-valuef) f0-0)
(set! (-> *part-id-table* 2214 init-specs 3 initial-valuef) f3-0)
(set! (-> *part-id-table* 2211 init-specs 1 initial-valuef) f1-0)
(set! (-> *part-id-table* 2212 init-specs 1 initial-valuef) f2-1)
)
(set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) f1-0)
)
(let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-0 -2))))
(vector+! (-> s5-0 trans) s4-0 v1-29)
)
)
(spawn-from-mat (-> this engine-part) s5-0)
)
(sound-play "hover-jets" :id (-> this sound-id))
0
(none)
)
(defmethod spawn-shot-from-cspace-idx ((this robo-hover) (arg0 vector) (arg1 projectile-init-by-other-params) (arg2 int) (arg3 float))
(vector<-cspace! (-> arg1 pos) (-> this node-list data arg2))
(let ((s3-1
(quaternion-vector-angle!
(new 'stack-no-clear 'quaternion)
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg2 bone transform rvec) 1.0)
(* 273.06668 arg3)
)
)
(a1-8
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg2 bone transform uvec) 1.0)
)
)
(vector-orient-by-quat! (-> arg1 vel) a1-8 s3-1)
)
(vector-normalize! (-> arg1 vel) -819200.0)
(spawn-projectile robo-hover-shot arg1 this *default-dead-pool*)
0
(none)
)
(defmethod go-die ((this robo-hover))
"Go to the die state."
(cond
((and (-> this next-state) (= (-> this next-state name) 'knocked))
(go (method-of-object this explode))
)
((-> this enemy-info use-die-falling)
(go (method-of-object this die-falling))
)
(else
(go (method-of-object this die))
)
)
)
(defmethod hover-enemy-method-170 ((this robo-hover))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-robo-hover" (the-as (pointer level) #f)))
(the-as pair 0)
)
0
(none)
)
(defmethod init-enemy-collision! ((this robo-hover))
"Typical place to construct collision shapes"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrated-by) (penetrate
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
flut-attack
board
mech-punch
dark-punch
dark-smack
flut
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 9) 0)))
(set! (-> s5-0 total-prims) (the-as uint 10))
(set! (-> s4-0 prim-core collide-as) (collide-spec enemy camera-blocker los-blocker))
(set! (-> s4-0 prim-core collide-with) (collide-spec backgnd obstacle))
(set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 -5734.4 0.0 16384.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-14 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-14 prim-core collide-with) (collide-spec backgnd obstacle))
(set! (-> v1-14 prim-core action) (collide-action solid deadly))
(set! (-> v1-14 transform-index) 0)
(set-vector! (-> v1-14 local-sphere) 0.0 10240.0 -2048.0 6144.0)
)
(let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-16 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-16 prim-core collide-with) (collide-spec backgnd obstacle))
(set! (-> v1-16 prim-core action) (collide-action solid deadly))
(set! (-> v1-16 transform-index) 0)
(set-vector! (-> v1-16 local-sphere) 0.0 8192.0 -2048.0 4915.2)
)
(let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-18 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-18 prim-core collide-with) (collide-spec backgnd obstacle))
(set! (-> v1-18 prim-core action) (collide-action solid deadly))
(set! (-> v1-18 transform-index) 0)
(set-vector! (-> v1-18 local-sphere) 0.0 12288.0 -2048.0 4915.2)
)
(let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-20 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-20 prim-core action) (collide-action semi-solid deadly))
(set! (-> v1-20 transform-index) 27)
(set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 3276.8)
)
(let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-22 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-22 prim-core action) (collide-action semi-solid deadly))
(set! (-> v1-22 transform-index) 33)
(set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 3276.8)
)
(let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-24 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-24 prim-core action) (collide-action semi-solid))
(set! (-> v1-24 transform-index) 11)
(set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2457.6)
)
(let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-26 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-26 prim-core action) (collide-action semi-solid))
(set! (-> v1-26 transform-index) 15)
(set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 2457.6)
)
(let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-28 prim-core collide-as) (collide-spec los-blocker))
(set! (-> v1-28 prim-core action) (collide-action semi-solid))
(set-vector! (-> v1-28 local-sphere) 0.0 10240.0 0.0 8192.0)
)
(let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-30 prim-core collide-as) (collide-spec camera-blocker))
(set! (-> v1-30 prim-core action) (collide-action solid))
(set! (-> v1-30 transform-index) 3)
(set-vector! (-> v1-30 local-sphere) 0.0 -5734.4 0.0 16384.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-33 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-33 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-33 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod get-enemy-info ((this robo-hover))
*robo-hover-enemy-info*
)
(defmethod get-hover-info ((this robo-hover))
(new 'static 'hover-enemy-info
:fly-forward-anim 3
:fly-backward-anim 4
:fly-left-anim 5
:fly-right-anim 6
:shoot-anim 7
:main-joint 3
:gun-base 10
:engine-left 22
:engine-right 19
:hover-y-offset 26624.0
:hover-xz-offset 61440.0
:use-flying-death #f
:fly-x-anim-seek 0.4
:fly-z-anim-seek 0.6
)
)
(defmethod get-hover-params ((this robo-hover))
(new 'static 'hover-nav-params
:max-speed 32768.0
:max-acceleration 57344.0
:max-rotation-rate 14563.556
:friction 0.05
)
)
(defmethod coin-flip? ((this robo-hover))
"Return #t half the time, #f the other."
#f
)
;; WARN: Return type mismatch hover-enemy vs robo-hover.
(defmethod relocate ((this robo-hover) (offset int))
(if (nonzero? (-> this smoke-part))
(&+! (-> this smoke-part) offset)
)
(if (nonzero? (-> this engine-part))
(&+! (-> this engine-part) offset)
)
(the-as robo-hover ((method-of-type hover-enemy relocate) this offset))
)
(defmethod deactivate ((this robo-hover))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (nonzero? (-> this smoke-part))
(kill-particles (-> this smoke-part))
)
(if (nonzero? (-> this engine-part))
(kill-particles (-> this engine-part))
)
(sound-stop (-> this sound-id))
((method-of-type hover-enemy deactivate) this)
(none)
)
(defun robo-hover-arm-jmod ((arg0 cspace) (arg1 transformq))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(cspace<-parented-transformq-joint! arg0 arg1)
(let* ((s4-0 (-> arg0 param1))
(s2-0 (the-as object (-> arg0 param2)))
(sv-80 (vector<-cspace! (new 'stack-no-clear 'vector) arg0))
(s0-0 (-> (the-as robo-hover s4-0) aim-position))
(s1-0 (new 'stack-no-clear 'vector))
(sv-96 (matrix->quat (-> arg0 bone transform) (new 'stack-no-clear 'quaternion)))
(s3-0 (new 'stack-no-clear 'quaternion))
)
(let ((v1-1 s1-0))
(.lvf vf4 (&-> s0-0 quad))
(.lvf vf5 (&-> sv-80 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-1 quad) vf6)
)
(vector-normalize! s1-0 1.0)
(vector-inv-orient-by-quat! s1-0 s1-0 sv-96)
(quaternion-from-two-vectors-max-angle-partial!
s3-0
*y-vector*
s1-0
16384.0
(-> (the-as robo-hover s4-0) gun-blend)
)
(quaternion-normalize! s3-0)
(quaternion*! s3-0 s3-0 (-> (the-as robo-hover s4-0) wrist-quat (the-as int s2-0)))
(quaternion-normalize! s3-0)
(quaternion*! (-> arg1 quat) (-> arg1 quat) s3-0)
)
(quaternion-normalize! (-> arg1 quat))
(cspace<-parented-transformq-joint! arg0 arg1)
0
(none)
)
)
(defmethod init-enemy! ((this robo-hover))
"Typical place for shared init code. Runs from entity or process style init."
(hover-enemy-method-170 this)
(setup-enemy! this (get-enemy-info this))
(hover-enemy-method-176 this)
(set! (-> this neck up) (the-as uint 1))
(set! (-> this neck nose) (the-as uint 2))
(set! (-> this neck ear) (the-as uint 0))
(set! (-> this scale) 1.0)
(set! (-> this sound-id) (new-sound-id))
(set! (-> this root dynam gravity y) 327680.0)
(set! (-> this root dynam gravity-length) 327680.0)
(set! (-> this root dynam gravity-max) 327680.0)
;; og:preserve-this moved to after ja-post
; (let ((a0-7 (-> this node-list data 10)))
; (set! (-> a0-7 param0) robo-hover-arm-jmod)
; (set! (-> a0-7 param1) this)
; (set! (-> a0-7 param2) (the-as basic 0))
; )
; (let ((v1-23 (-> this node-list data 14)))
; (set! (-> v1-23 param0) robo-hover-arm-jmod)
; (set! (-> v1-23 param1) this)
; (set! (-> v1-23 param2) (the-as basic 1))
; )
(logior! (-> this mask) (process-mask kg-robot))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(let* ((sv-16 (new 'static 'res-tag))
(v1-31 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))
)
(if (and v1-31 (= (-> sv-16 elt-count) 1))
(set! (-> this entity-group) (-> v1-31 0))
(set! (-> this entity-group) #f)
)
)
(let* ((sv-32 (new 'static 'res-tag))
(v1-35 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))
)
(cond
((and v1-35 (= (-> sv-32 elt-count) 2))
(set! (-> this attack-wait-min) (-> v1-35 0))
(set! (-> this attack-wait-max) (-> v1-35 1))
)
(else
(set! (-> this attack-wait-min) 3.0)
(set! (-> this attack-wait-max) 5.0)
)
)
)
(set! (-> this knocked-fall-dist) 0.0)
(let* ((sv-48 (new 'static 'res-tag))
(v1-41 (res-lump-data (-> this entity) 'min-max pointer :tag-ptr (& sv-48)))
)
(set! (-> this attack-miss-dist-min) (if (and v1-41 (> (the-as int (-> sv-48 elt-count)) 0))
(-> (the-as (pointer float) v1-41))
-14336.0
)
)
)
(let* ((sv-64 (new 'static 'res-tag))
(v1-44 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))
)
(set! (-> this attack-miss-dist-max) (if (and v1-44 (< 1 (the-as int (-> sv-64 elt-count))))
(-> v1-44 1)
14336.0
)
)
)
(set! (-> this attack-miss-dist-curr) 0.0)
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f))
(set! (-> this path-u) 0.0)
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> this smoke-part) (create-launch-control group-robo-gun-smoke this))
(set! (-> this engine-part) (create-launch-control group-robo-engine this))
(add-connection
*part-engine*
this
6
this
468
(new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0)
)
(add-connection
*part-engine*
this
6
this
468
(new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0)
)
(add-connection *part-engine* this 6 this 2204 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0))
(ja-channel-set! 1)
(let ((a0-42 (-> this skel root-channel 0)))
(set! (-> a0-42 frame-group) (the-as art-joint-anim (-> this draw art-group data 9)))
(set! (-> a0-42 frame-num) 0.0)
(joint-control-channel-group! a0-42 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity)
)
(ja-post)
;; og:preserve-this
(let ((a0-7 (-> this node-list data 10)))
(set! (-> a0-7 param0) robo-hover-arm-jmod)
(set! (-> a0-7 param1) this)
(set! (-> a0-7 param2) (the-as basic 0))
)
(let ((v1-23 (-> this node-list data 14)))
(set! (-> v1-23 param0) robo-hover-arm-jmod)
(set! (-> v1-23 param1) this)
(set! (-> v1-23 param2) (the-as basic 1))
)
(quaternion-from-two-vectors!
(-> this wrist-quat 0)
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 14 bone transform uvec) 1.0)
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 15 bone transform uvec) 1.0)
)
(quaternion-from-two-vectors!
(-> this wrist-quat 1)
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 10 bone transform uvec) 1.0)
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 11 bone transform uvec) 1.0)
)
0
(none)
)