jak-project/goal_src/jak2/levels/drill_platform/drill-baron.gc
Hat Kid 67d4eda169
decomp: hover-* files, wasp, crimson-guard-hover, flamer, target-turret, drill-turret, jellyfish (#2198)
Manual patches:

- `drill-turret`: The static data for `*turret-13-path*`,
`*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the
integers in the `set-speed-mult` events have been replaced with boxed
integer arrays that contain only that integer in order to make the
compiler happy. To that effect, the event handler in `target-turret` was
changed to access that array instead of just accessing the int.
- `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a
`vector`, but there are some places where it is called with `#t` as
`arg2` and, subsequently, crashes the game because it tries to access
the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the
condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in
this case, it would jump to the `else` that just resets the `dest-vel`
and `transv` `quad`s)
- `drill-baron`: The static data for `*drill-ship-turret-speed-event*`
has been decompiled by hand.

TODOs:
- Jellyfish crash the game
- Destroying the metalhead eggs that are on the breakable wall crashes
the game (already happened with the Peacemaker before)
- Figure out why static data of type `turret-path-event` doesn't
decompile

The docs for all the hover-nav and nav-network code could use some love
in the future, I'm not smart enough to figure out what any of that code
actually means, but it seems to work...

Also threw in the fix for the ▲ that was accidentally left commented
out.
2023-02-09 18:22:56 -05:00

2085 lines
71 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: drill-baron.gc
;; name in dgo: drill-baron
;; dgos: DMI
;; DECOMP BEGINS
(defpartgroup group-turret-warning
:id 458
:duration (seconds 0.2)
:linger-duration (seconds 1)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 15)
:parts ((sp-item 2037 :flags (bit7) :period 930 :length 40))
)
(defpartgroup group-turret-warning-down
:id 459
:duration (seconds 0.2)
:linger-duration (seconds 1)
:flags (use-local-clock unk-6)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 8) (degrees 0) (degrees 0))
:parts ((sp-item 2037 :flags (bit7) :period 930 :length 40))
)
(defpartgroup group-turret-warning-side
:id 460
:duration (seconds 0.2)
:linger-duration (seconds 1)
:flags (use-local-clock unk-6)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 4) (degrees 4) (degrees 0))
:parts ((sp-item 2037 :flags (bit7) :period 930 :length 40))
)
(defpart 2037
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc))
(sp-flt spt-num 16.0)
(sp-flt spt-x (meters 4))
(sp-flt spt-y (meters 1))
(sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-rnd-flt spt-r 128.0 128.0 1.0)
(sp-copy-from-other spt-g -1)
(sp-copy-from-other spt-b -1)
(sp-rnd-flt spt-a 32.0 32.0 1.0)
(sp-rnd-flt spt-vel-x (meters 0.026666667) (meters 0.026666667) 1.0)
(sp-rnd-flt spt-vel-y (meters 0.026666667) (meters 0.026666667) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0)
(sp-flt spt-friction 0.94)
(sp-int spt-timer 450)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12)
(sp-int-plain-rnd spt-next-time 35 14 1)
(sp-launcher-by-id spt-next-launcher 2038)
(sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0)
)
)
(defpart 2038
:init-specs ((sp-rnd-flt spt-fade-a -0.14222223 -0.42666668 1.0))
)
(defpartgroup group-barons-ship-light1
:id 461
:bounds (static-bspherem 0 0 0 1)
:parts ((sp-item 2039 :flags (bit6) :period 375 :length 5))
)
(defpartgroup group-barons-ship-light2
:id 462
:bounds (static-bspherem 0 0 0 1)
:parts ((sp-item 2039 :flags (bit6) :period 375 :length 5 :offset 75))
)
(defpartgroup group-barons-ship-light3
:id 463
:bounds (static-bspherem 0 0 0 1)
:parts ((sp-item 2039 :flags (bit6) :period 375 :length 5 :offset 150))
)
(defpartgroup group-barons-ship-light4
:id 464
:bounds (static-bspherem 0 0 0 1)
:parts ((sp-item 2039 :flags (bit6) :period 375 :length 5 :offset 225))
)
(defpartgroup group-barons-ship-light5
:id 465
:bounds (static-bspherem 0 0 0 1)
:parts ((sp-item 2039 :flags (bit6) :period 375 :length 5 :offset 300))
)
(defpart 2039
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc))
(sp-flt spt-num 1.0)
(sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0)
(sp-flt spt-rot-x 1024.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-rnd-flt spt-g 0.0 128.0 1.0)
(sp-flt spt-b 0.0)
(sp-rnd-flt spt-a 64.0 32.0 1.0)
(sp-flt spt-omega 4097638.5)
(sp-int spt-timer 75)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)
(sp-flt spt-userdata 2048.0)
(sp-func spt-func 'sparticle-track-root)
(sp-flt spt-rotate-y (degrees 0.0))
)
)
(defpartgroup group-turret-smoke-trail
:id 466
:linger-duration (seconds 1.5)
:bounds (static-bspherem 0 0 0 6)
:parts ((sp-item 2040 :flags (bit7)) (sp-item 2041 :flags (bit6 bit7)))
)
(defpartgroup group-turret-smoke-trail-down
:id 467
:linger-duration (seconds 1.5)
:flags (unk-6)
:bounds (static-bspherem 0 0 0 6)
:rotate ((degrees 8) (degrees 0) (degrees 0))
:parts ((sp-item 2040 :flags (bit7)) (sp-item 2041 :flags (bit6 bit7)))
)
(defpartgroup group-turret-smoke-trail-side
:id 468
:linger-duration (seconds 1.5)
:flags (unk-6)
:bounds (static-bspherem 0 0 0 6)
:rotate ((degrees 4) (degrees 4) (degrees 0))
:parts ((sp-item 2040 :flags (bit7)) (sp-item 2041 :flags (bit6 bit7)))
)
(defpart 2041
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc))
(sp-flt spt-num 1.0)
(sp-rnd-flt spt-x (meters 0) (meters 2) 1.0)
(sp-flt spt-y (meters 1))
(sp-rnd-flt spt-scale-x (meters 12) (meters 3) 1.0)
(sp-flt spt-rot-x 1228.8)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-rnd-flt spt-g 64.0 128.0 1.0)
(sp-rnd-flt spt-b 0.0 64.0 1.0)
(sp-rnd-flt spt-a 12.0 4.0 1.0)
(sp-flt spt-omega 822476.8)
(sp-flt spt-fade-a -0.8)
(sp-int spt-timer 20)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)
(sp-flt spt-userdata 6144.0)
(sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0)
)
)
(defpart 2040
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc))
(sp-func spt-birth-func 'birth-func-texture-group)
(sp-flt spt-num 0.5)
(sp-rnd-flt spt-x (meters 0) (meters 4) 1.0)
(sp-rnd-flt spt-scale-x (meters 8) (meters 4) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-flt spt-g 246.0)
(sp-flt spt-b 149.0)
(sp-rnd-flt spt-a 32.0 32.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.033333335) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.006666667) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.14666666)
(sp-flt spt-fade-g -0.7866667)
(sp-flt spt-fade-b -0.88)
(sp-rnd-flt spt-fade-a -0.053333335 -0.053333335 1.0)
(sp-rnd-flt spt-accel-x 5.4613333 1.3653333 1.0)
(sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0)
(sp-flt spt-friction 0.96)
(sp-int spt-timer 2400)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 use-global-acc)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-userdata)
:flags (sp-flag plain-v2)
:object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc00000 #xc03300)
)
(sp-int-plain-rnd spt-next-time 50 24 1)
(sp-launcher-by-id spt-next-launcher 2042)
(sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0)
)
)
(defpart 2042
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.0033333334) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-int-plain-rnd spt-next-time 75 24 1)
(sp-launcher-by-id spt-next-launcher 2043)
)
)
(defpart 2043
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0016666667) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -2.33)
(sp-flt spt-fade-g -1.28)
(sp-flt spt-fade-b -0.17)
(sp-int-plain-rnd spt-next-time 75 24 1)
(sp-launcher-by-id spt-next-launcher 2044)
)
)
(defpart 2044
:init-specs ((sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g 0.0)
(sp-flt spt-fade-b 0.0)
(sp-rnd-flt spt-fade-a -0.03 -0.24 1.0)
)
)
(defpartgroup group-drill-barons-ship-explosion
:id 469
:duration (seconds 3)
:linger-duration (seconds 2)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 2)
:parts ((sp-item 2045 :period 9600 :length 25)
(sp-item 2046 :period 9600 :length 10 :offset 10)
(sp-item 2047 :period 9600 :length 50 :offset 25)
(sp-item 2048 :period 9600 :length 35 :offset 10)
(sp-item 2049 :period 9600 :length 50 :offset 15)
(sp-item 2050 :period 9600 :length 5)
(sp-item 2051 :period 9600 :length 50 :offset 15)
(sp-item 2052 :period 9600 :length 5)
(sp-item 2053 :flags (is-3d) :period 9600 :length 5)
)
)
(defpart 2053
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc))
(sp-flt spt-num 8.0)
(sp-flt spt-scale-x (meters 16))
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-copy-from-other spt-g -1)
(sp-flt spt-b 128.0)
(sp-flt spt-a 136.0)
(sp-flt spt-scalevel-x (meters 2))
(sp-flt spt-rotvel-y (degrees 0.1))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -1.0625)
(sp-flt spt-fade-g -2.125)
(sp-flt spt-fade-b -2.1333334)
(sp-flt spt-fade-a -3.2)
(sp-int spt-timer 320)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)
(sp-int spt-next-time 40)
(sp-launcher-by-id spt-next-launcher 2054)
(sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0)
)
)
(defpart 2054
:init-specs ((sp-flt spt-fade-a -0.06666667))
)
(defpart 2050
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc))
(sp-flt spt-num 1.0)
(sp-flt spt-y (meters -2.5))
(sp-flt spt-scale-x (meters 32))
(sp-flt spt-rot-x 8192.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-flt spt-a 96.0)
(sp-flt spt-scalevel-x (meters 0.26666668))
(sp-flt spt-rotvel-z (degrees 0.3))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -1.28)
(sp-flt spt-fade-b -5.1)
(sp-flt spt-fade-a 0.0)
(sp-int spt-timer 65)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)
(sp-flt spt-userdata 122880.0)
(sp-int spt-next-time 30)
(sp-launcher-by-id spt-next-launcher 2055)
)
)
(defpart 2055
:init-specs ((sp-flt spt-scalevel-x (meters -0.22857143))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -3.6571429)
(sp-flt spt-fade-b 0.0)
(sp-flt spt-fade-a -2.7428572)
)
)
(defpart 2052
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc))
(sp-flt spt-num 1.0)
(sp-flt spt-scale-x (meters 120))
(sp-flt spt-rot-x 8192.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-flt spt-a 24.0)
(sp-flt spt-scalevel-x (meters 0.4))
(sp-flt spt-rotvel-z (degrees 0.3))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -4.266667)
(sp-flt spt-fade-b -4.266667)
(sp-flt spt-fade-a 0.0)
(sp-int spt-timer 150)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)
(sp-flt spt-userdata 409600.0)
(sp-int spt-next-time 75)
(sp-launcher-by-id spt-next-launcher 2056)
)
)
(defpart 2056
:init-specs ((sp-flt spt-scalevel-x (meters 0))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.85333335)
(sp-flt spt-fade-g -1.7066667)
(sp-flt spt-fade-b -1.7066667)
(sp-flt spt-fade-a -0.64)
)
)
(defpart 2048
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc))
(sp-flt spt-num 16.0)
(sp-flt spt-y (meters 0))
(sp-flt spt-scale-x (meters 2.5))
(sp-int spt-rot-x 4)
(sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.3) 1.0)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-rnd-flt spt-a 64.0 32.0 1.0)
(sp-flt spt-omega 12.288)
(sp-rnd-flt spt-vel-y (meters 0.53333336) (meters 0.33333334) 1.0)
(sp-flt spt-fade-b -8.0)
(sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0)
(sp-rnd-flt spt-friction 0.9 0.08 1.0)
(sp-int-plain-rnd spt-timer 450 299 1)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)
(sp-func spt-func 'sparticle-motion-blur)
(sp-int spt-next-time 15)
(sp-launcher-by-id spt-next-launcher 2057)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0)
(sp-flt spt-rotate-y (degrees 90.0))
)
)
(defpart 2057
:init-specs ((sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 0.0)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -2.6133332)
(sp-flt spt-fade-b -1.7066667)
(sp-rnd-flt spt-fade-a -0.096 -0.096 1.0)
(sp-int spt-next-time 75)
(sp-launcher-by-id spt-next-launcher 2058)
)
)
(defpart 2058
:init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0))
)
(defpart 2051
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc))
(sp-flt spt-num 5.0)
(sp-flt spt-y (meters -2.5))
(sp-rnd-flt spt-scale-x (meters 6) (meters 8) 1.0)
(sp-int spt-rot-x 4)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-rot-z)
:flags (sp-flag spflag7)
:random-rangef 655360.0
:random-multf 1.0
)
(sp-rnd-flt spt-scale-y (meters 20) (meters 8) 1.0)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-rnd-flt spt-a 16.0 16.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.4) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.26666668) (meters 0.13333334) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -0.36)
(sp-flt spt-fade-b -4.24)
(sp-flt spt-fade-a -0.13333334)
(sp-rnd-flt spt-friction 0.92 0.02 1.0)
(sp-int spt-timer 1000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(sp-func spt-func 'sparticle-motion-blur)
(sp-int spt-next-time 25)
(sp-launcher-by-id spt-next-launcher 2059)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-conerot-x)
:flags (sp-flag from-pointer)
:func '*sp-temp*
)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0)
(sp-flt spt-rotate-y (degrees 90.0))
(sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0)
)
)
(defpart 2059
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.55)
(sp-flt spt-fade-g -2.95)
(sp-flt spt-fade-b -3.3)
(sp-int-plain-rnd spt-next-time 30 9 1)
(sp-launcher-by-id spt-next-launcher 2060)
)
)
(defpart 2060
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -1.2944444)
(sp-flt spt-fade-g -0.7111111)
(sp-flt spt-fade-b -0.2)
(sp-rnd-flt spt-fade-a -0.1 -0.1 1.0)
)
)
(defpart 2049
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc))
(sp-func spt-birth-func 'birth-func-texture-group)
(sp-rnd-flt spt-num 16.0 10.0 1.0)
(sp-flt spt-y (meters -2.5))
(sp-rnd-flt spt-scale-x (meters 6) (meters 4) 1.0)
(sp-flt spt-rot-z (degrees 0.0))
(sp-rnd-flt spt-scale-y (meters 12.8) (meters 2.4) 1.0)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-rnd-flt spt-a 32.0 32.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.2) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.26666668) (meters 0.2) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -0.36)
(sp-flt spt-fade-b -4.24)
(sp-flt spt-fade-a -0.32)
(sp-flt spt-friction 0.94)
(sp-int spt-timer 1000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-userdata)
:flags (sp-flag plain-v2)
:object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc03300)
)
(sp-int spt-next-time 25)
(sp-launcher-by-id spt-next-launcher 2061)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0)
(sp-flt spt-rotate-y (degrees 90.0))
(sp-rnd-flt spt-conerot-radius (meters 0) (meters 8) 1.0)
)
)
(defpart 2061
:init-specs ((sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g 0.0)
(sp-flt spt-fade-b 0.0)
(sp-int-plain-rnd spt-next-time 5 19 1)
(sp-launcher-by-id spt-next-launcher 2062)
)
)
(defpart 2062
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.44)
(sp-flt spt-fade-g -2.36)
(sp-flt spt-fade-b -2.64)
(sp-int-plain-rnd spt-next-time 35 14 1)
(sp-launcher-by-id spt-next-launcher 2063)
)
)
(defpart 2063
:init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -1.2)
(sp-flt spt-fade-g -0.7111111)
(sp-flt spt-fade-b -0.2)
(sp-rnd-flt spt-fade-a -0.06545454 -0.06545454 1.0)
(sp-int-plain-rnd spt-next-time 150 29 1)
(sp-launcher-by-id spt-next-launcher 2064)
)
)
(defpart 2064
:init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.1125))
)
(defpart 2047
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc))
(sp-rnd-flt spt-num 16.0 4.0 1.0)
(sp-flt spt-x (meters 0.25))
(sp-flt spt-y (meters -2.5))
(sp-rnd-flt spt-scale-x (meters 4) (meters 4) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-flt spt-g 255.0)
(sp-flt spt-b 255.0)
(sp-rnd-flt spt-a 32.0 48.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.13333334) (meters 0.8) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.02) (meters 0.02) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -0.18)
(sp-flt spt-fade-b -2.12)
(sp-rnd-flt spt-accel-y -5.4613333 -23.210667 1.0)
(sp-rnd-flt spt-friction 0.84 0.02 1.0)
(sp-int spt-timer 3000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(sp-int-plain-rnd spt-next-time 35 14 1)
(sp-launcher-by-id spt-next-launcher 2065)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0)
(sp-flt spt-rotate-y (degrees 90.0))
(sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0)
)
)
(defpart 2065
:init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g 0.02)
(sp-flt spt-fade-b 0.23555556)
(sp-int-plain-rnd spt-next-time 45 14 1)
(sp-launcher-by-id spt-next-launcher 2066)
)
)
(defpart 2066
:init-specs ((sp-flt spt-fade-r -0.5543478)
(sp-flt spt-fade-g -0.5543478)
(sp-flt spt-fade-b -0.5543478)
(sp-rnd-flt spt-fade-a -0.13333334 -0.10666667 1.0)
)
)
(defpart 2045
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc))
(sp-rnd-flt spt-num 12.0 8.0 1.0)
(sp-flt spt-y (meters -2.5))
(sp-rnd-flt spt-scale-x (meters 16.5) (meters 16) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-rnd-flt spt-r 70.0 20.0 1.0)
(sp-rnd-flt spt-g 70.0 20.0 1.0)
(sp-rnd-flt spt-b 70.0 20.0 1.0)
(sp-rnd-flt spt-a 0.0 40.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.33333334) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.086666666) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 3.3)
(sp-flt spt-fade-g 3.12)
(sp-flt spt-fade-b 1.18)
(sp-flt spt-fade-a 1.76)
(sp-flt spt-friction 0.89)
(sp-int spt-timer 710)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)
(sp-int-plain-rnd spt-next-time 35 14 1)
(sp-launcher-by-id spt-next-launcher 2067)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0)
(sp-flt spt-rotate-y (degrees 90.0))
(sp-rnd-flt spt-conerot-radius (meters 0) (meters 16) 1.0)
)
)
(defpart 2067
:init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.53333336)
(sp-flt spt-fade-g -1.9666667)
(sp-flt spt-fade-b -2.2)
(sp-flt spt-fade-a -0.41666666)
(sp-int-plain-rnd spt-next-time 45 14 1)
(sp-launcher-by-id spt-next-launcher 2068)
)
)
(defpart 2068
:init-specs ((sp-flt spt-scalevel-x (meters 0))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r -0.38833332)
(sp-flt spt-fade-g -0.21333334)
(sp-flt spt-fade-b -0.028333334)
(sp-flt spt-fade-a -0.38833332)
)
)
(defpart 2046
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc))
(sp-flt spt-num 8.0)
(sp-flt spt-y (meters -2.5))
(sp-rnd-flt spt-scale-x (meters 16) (meters 16) 1.0)
(sp-int spt-rot-x 4)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-rnd-flt spt-scale-y (meters 1.5) (meters 0.5) 1.0)
(sp-rnd-flt spt-r 128.0 128.0 1.0)
(sp-flt spt-g 96.0)
(sp-flt spt-b 64.0)
(sp-rnd-flt spt-a 64.0 64.0 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.4) (meters 0.4) 1.0)
(sp-flt spt-fade-g 1.6)
(sp-flt spt-fade-b 3.2)
(sp-flt spt-fade-a -0.9142857)
(sp-int spt-timer 90)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
)
)
(defskelgroup skel-drill-barons-ship drill-barons-ship drill-barons-ship-lod0-jg drill-barons-ship-idle-ja
((drill-barons-ship-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 110)
)
(defskelgroup skel-drill-barons-ship-explode drill-barons-ship drill-barons-ship-explode-lod0-jg drill-barons-ship-explode-idle-ja
((drill-barons-ship-explode-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 210)
)
(defskelgroup skel-drill-barons-ship-turret drill-barons-ship drill-barons-ship-turret-lod0-jg drill-barons-ship-turret-idle-ja
((drill-barons-ship-turret-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 10)
)
(defskelgroup skel-drill-barons-ship-turret-b drill-barons-ship drill-barons-ship-turret-b-lod0-jg drill-barons-ship-turret-b-idle-ja
((drill-barons-ship-turret-b-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 10)
)
(defskelgroup skel-drill-barons-ship-turret-c drill-barons-ship drill-barons-ship-turret-c-lod0-jg drill-barons-ship-turret-c-idle-ja
((drill-barons-ship-turret-c-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 10)
)
(deftype drill-barons-ship (process-drawable)
((root-override collide-shape-moving :offset 128)
(init-quat quaternion :inline :offset-assert 208)
(next-to-shoot-idx int32 :offset-assert 224)
(current-y-position float :offset-assert 228)
(from-y float :offset-assert 232)
(inc-y float :offset-assert 236)
(ease-y float :offset-assert 240)
(x-offset-angle float :offset-assert 244)
(pass int32 :offset-assert 248)
(end-of-pass symbol :offset-assert 252)
(rock-angle float :offset-assert 256)
(soundid uint32 :offset-assert 260)
)
:heap-base #x90
:method-count-assert 23
:size-assert #x108
:flag-assert #x1700900108
(:methods
(idle () _type_ :state 20)
(hidden () _type_ :state 21)
(drill-barons-ship-method-22 (_type_) none 22)
)
)
(deftype drill-barons-ship-explode (process-drawable)
()
:heap-base #x50
:method-count-assert 21
:size-assert #xc8
:flag-assert #x15005000c8
(:methods
(idle () _type_ :state 20)
)
)
(deftype barons-ship-turret-info (structure)
((init-y-angle float :offset-assert 0)
(twist-y-max float :offset-assert 4)
(joint-idx int32 :offset-assert 8)
(mesh int32 :offset-assert 12)
(ship-y-offset float :offset-assert 16)
(alive symbol :offset-assert 20)
(next-to-shoot basic :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(deftype drill-barons-ship-turret (process-drawable)
((root-override collide-shape-moving :offset 128)
(info barons-ship-turret-info :offset-assert 200)
(shot-timer time-frame :offset-assert 208)
(shot-counter int32 :offset-assert 216)
(jmod joint-mod :offset-assert 220)
(jmod-left joint-mod :offset-assert 224)
(jmod-right joint-mod :offset-assert 228)
(anim-frame float :offset-assert 232)
(error-y-angle float :offset-assert 236)
(error-y-angle-dest float :offset-assert 240)
(hit-count int32 :offset-assert 244)
(soundid sound-id :offset-assert 248)
)
:heap-base #x80
:method-count-assert 25
:size-assert #xfc
:flag-assert #x19008000fc
(:methods
(idle () _type_ :state 20)
(attack () _type_ :state 21)
(dead () _type_ :state 22)
(going-down () _type_ :state 23)
(drill-barons-ship-turret-method-24 (_type_) none 24)
)
)
(define *ship-turrets-first-pass* (new 'static 'boxed-array :type int32 4 16 5 21 6 15 7 13 14 22 17 23))
(define *ship-turrets-second-pass* (new 'static 'boxed-array :type int32 0 20 1 12 2 11 3 8 19 9 10 18))
(define *barons-ship-turrets*
(new 'static 'boxed-array :type barons-ship-turret-info
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 13
:ship-y-offset -40960.0
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 11
:ship-y-offset -41369.6
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 9
:ship-y-offset -41779.2
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 16
:ship-y-offset -42188.8
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 22
:ship-y-offset -42598.4
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 20
:ship-y-offset -43008.0
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 18
:ship-y-offset -43417.6
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 25
:ship-y-offset -43827.2
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 15
:mesh 2
:ship-y-offset 40960.0
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 14
:mesh 2
:ship-y-offset 41369.6
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 12
:mesh 2
:ship-y-offset 41779.2
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 10
:mesh 2
:ship-y-offset 42188.8
)
(new 'static 'barons-ship-turret-info
:init-y-angle -16384.0
:twist-y-max 9102.223
:joint-idx 17
:mesh 2
:ship-y-offset 42598.4
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 24
:mesh 2
:ship-y-offset 43008.0
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 23
:mesh 2
:ship-y-offset 43417.6
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 21
:mesh 2
:ship-y-offset 43827.2
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 19
:mesh 2
:ship-y-offset 44236.8
)
(new 'static 'barons-ship-turret-info
:init-y-angle 16384.0
:twist-y-max 9102.223
:joint-idx 26
:mesh 2
:ship-y-offset 44646.4
)
(new 'static 'barons-ship-turret-info :init-y-angle -16384.0 :joint-idx 32 :mesh 1 :ship-y-offset 26624.0)
(new 'static 'barons-ship-turret-info :init-y-angle -16384.0 :joint-idx 31 :mesh 1 :ship-y-offset 27033.6)
(new 'static 'barons-ship-turret-info :init-y-angle -16384.0 :joint-idx 30 :mesh 1 :ship-y-offset 27443.2)
(new 'static 'barons-ship-turret-info :init-y-angle 16384.0 :joint-idx 29 :mesh 1 :ship-y-offset 21708.8)
(new 'static 'barons-ship-turret-info :init-y-angle 16384.0 :joint-idx 28 :mesh 1 :ship-y-offset 22118.4)
(new 'static 'barons-ship-turret-info :init-y-angle 16384.0 :joint-idx 27 :mesh 1 :ship-y-offset 22528.0)
)
)
;; WARN: Return type mismatch object vs none.
(defbehavior drill-barons-ship-turret-init-by-other drill-barons-ship-turret ((arg0 entity-actor))
(cond
((!= (-> arg0 data-top) 1)
(let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player))))
(let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-3 prim-core collide-as) (collide-spec obstacle-for-jak))
(set! (-> v1-3 prim-core action) (collide-action solid))
(set! (-> v1-3 transform-index) 3)
(set-vector! (-> v1-3 local-sphere) 0.0 0.0 0.0 73728.0)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) v1-3)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-6 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with))
)
(set! (-> self root-override) (the-as collide-shape-moving s5-0))
)
)
(else
(let ((s5-1 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player))))
(let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-1 (the-as uint 0))))
(set! (-> v1-10 prim-core collide-as) (collide-spec obstacle-for-jak))
(set! (-> v1-10 prim-core action) (collide-action solid))
(set! (-> v1-10 transform-index) 3)
(set-vector! (-> v1-10 local-sphere) 81920.0 0.0 0.0 73728.0)
(set! (-> s5-1 total-prims) (the-as uint 1))
(set! (-> s5-1 root-prim) v1-10)
)
(set! (-> s5-1 nav-radius) (* 0.75 (-> s5-1 root-prim local-sphere w)))
(let ((v1-13 (-> s5-1 root-prim)))
(set! (-> s5-1 backup-collide-as) (-> v1-13 prim-core collide-as))
(set! (-> s5-1 backup-collide-with) (-> v1-13 prim-core collide-with))
)
(set! (-> self root-override) (the-as collide-shape-moving s5-1))
)
)
)
(let ((v1-16 (-> self root-override root-prim)))
(set! (-> self root-override backup-collide-as) (-> v1-16 prim-core collide-as))
(set! (-> self root-override backup-collide-with) (-> v1-16 prim-core collide-with))
)
(let ((v1-19 (-> self root-override root-prim)))
(set! (-> v1-19 prim-core collide-as) (collide-spec))
(set! (-> v1-19 prim-core collide-with) (collide-spec))
)
0
(set! (-> self root-override trans quad)
(-> (the-as drill-barons-ship (-> self parent 0)) root-override trans quad)
)
(quaternion-copy!
(-> self root-override quat)
(-> (the-as drill-barons-ship (-> self parent 0)) root-override quat)
)
(vector-identity! (-> self root-override scale))
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self info) (the-as barons-ship-turret-info arg0))
(set! (-> self info alive) #t)
(set! (-> self info next-to-shoot) #f)
(set! (-> self anim-frame) 0.0)
(set! (-> self error-y-angle) 0.0)
(set! (-> self error-y-angle-dest) 0.0)
(set! (-> self hit-count) 0)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 461) -1 #f #f self 4 :to self)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 462) -1 #f #f self 5 :to self)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 463) -1 #f #f self 6 :to self)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 464) -1 #f #f self 7 :to self)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 465) -1 #f #f self 8 :to self)
(cond
((= (-> self info mesh) 1)
(initialize-skeleton
self
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-drill-barons-ship-turret-b" (the-as (pointer uint32) #f))
)
(the-as pair 0)
)
(set! (-> self jmod) #f)
(set! (-> self jmod-left) #f)
(set! (-> self jmod-right) #f)
(setup-masks (-> self draw) 3 0)
)
((= (-> self info mesh) 2)
(initialize-skeleton
self
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-drill-barons-ship-turret-c" (the-as (pointer uint32) #f))
)
(the-as pair 0)
)
(set! (-> self jmod) (the-as joint-mod (new 'process 'joint-mod-add-local self 6 #f #t #f)))
(set! (-> self jmod twist-min-y) (the-as float #t))
(quaternion-axis-angle! (the-as quaternion (-> self jmod twist)) 0.0 1.0 0.0 0.0)
(set! (-> self jmod-left) #f)
(set! (-> self jmod-right) #f)
(setup-masks (-> self draw) 3 0)
)
(else
(initialize-skeleton
self
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-drill-barons-ship-turret" (the-as (pointer uint32) #f))
)
(the-as pair 0)
)
(set! (-> self jmod) (the-as joint-mod (new 'process 'joint-mod-add-local self 10 #f #t #f)))
(set! (-> self jmod twist-min-y) (the-as float #t))
(set! (-> self jmod-left) (the-as joint-mod (new 'process 'joint-mod-add-local self 11 #f #t #f)))
(set! (-> self jmod-left twist-min-y) (the-as float #t))
(set! (-> self jmod-right) (the-as joint-mod (new 'process 'joint-mod-add-local self 12 #f #t #f)))
(set! (-> self jmod-right twist-min-y) (the-as float #t))
(quaternion-axis-angle! (the-as quaternion (-> self jmod twist)) 0.0 1.0 0.0 0.0)
(quaternion-axis-angle! (the-as quaternion (-> self jmod-left twist)) 0.0 0.0 1.0 0.0)
(quaternion-axis-angle! (the-as quaternion (-> self jmod-right twist)) 0.0 0.0 1.0 0.0)
(setup-masks (-> self draw) 3 0)
)
)
(go-virtual idle)
(none)
)
;; WARN: Return type mismatch process-drawable vs drill-barons-ship-turret.
(defmethod relocate drill-barons-ship-turret ((obj drill-barons-ship-turret) (arg0 int))
(when (-> obj jmod)
(if (nonzero? (-> obj jmod))
(&+! (-> obj jmod) arg0)
)
)
(when (-> obj jmod-left)
(if (nonzero? (-> obj jmod-left))
(&+! (-> obj jmod-left) arg0)
)
)
(when (-> obj jmod-right)
(if (nonzero? (-> obj jmod-right))
(&+! (-> obj jmod-right) arg0)
)
)
(the-as
drill-barons-ship-turret
((the-as (function process-drawable int process-drawable) (find-parent-method drill-barons-ship-turret 7))
obj
arg0
)
)
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! drill-barons-ship ((obj drill-barons-ship) (arg0 entity-actor))
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
This commonly includes things such as:
- stack size
- collision information
- loading the skeleton group / bones
- sounds"
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
(set! (-> s4-0 total-prims) (the-as uint 2))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 450560.0)
(set! (-> s4-0 root-prim) s3-0)
)
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-8 prim-core action) (collide-action solid))
(set! (-> v1-8 transform-index) 0)
(set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 450560.0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-11 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with))
)
(set! (-> obj root-override) (the-as collide-shape-moving s4-0))
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-drill-barons-ship" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(logior! (-> obj skel status) (joint-control-status sync-math))
(quaternion-vector-angle! (-> obj root-override quat) *y-vector* -16384.0)
(set-vector! (-> obj root-override trans) 737280.0 -1024000.0 -1433600.0 1.0)
(set! (-> obj next-to-shoot-idx) 0)
(quaternion-copy! (-> obj init-quat) (-> obj root-override quat))
(set! (-> obj current-y-position) (-> obj root-override trans y))
(set! (-> obj from-y) (-> obj current-y-position))
(set! (-> obj inc-y) 1228.8)
(set! (-> obj ease-y) 40960.0)
(set! (-> obj pass) 0)
(set! (-> obj end-of-pass) #f)
(set! (-> obj rock-angle) 0.0)
(let ((a0-21 (-> obj skel root-channel 0)))
(set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2)))
(set! (-> a0-21 frame-num) 0.0)
(joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity)
)
(ja-post)
(dotimes (s5-2 (length *barons-ship-turrets*))
(process-spawn drill-barons-ship-turret (-> *barons-ship-turrets* s5-2) :to obj)
)
(set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 3) alive) #f)
(set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 9) alive) #f)
(set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 11) alive) #f)
(set! (-> obj soundid) (the-as uint (sound-play "drl-ship-steady")))
(go (method-of-object obj hidden))
(none)
)
;; WARN: Return type mismatch object vs none.
(defbehavior drill-barons-ship-explode-init-by-other drill-barons-ship-explode ((arg0 entity-actor))
(set! (-> self root) (new 'process 'trsqv))
(logclear! (-> self mask) (process-mask actor-pause))
(process-entity-status! self (entity-perm-status no-kill) #t)
(quaternion-vector-angle! (-> self root quat) *y-vector* -16384.0)
(set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad))
(initialize-skeleton
self
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-drill-barons-ship-explode" (the-as (pointer uint32) #f))
)
(the-as pair 0)
)
(ja-no-eval :group! (-> self draw art-group data 5) :num! zero)
(ja-post)
(quaternion-rotate-local-y! (-> self root quat) (-> self root quat) 32768.0)
(add-process *gui-control* self (gui-channel background) (gui-action play) "shpxplo2" -99.0 0)
(go-virtual idle)
(none)
)
(deftype drill-ship-shot (guard-shot)
()
:heap-base #x170
:method-count-assert 40
:size-assert #x1f0
:flag-assert #x28017001f0
)
(defmethod deal-damage! drill-ship-shot ((obj drill-ship-shot) (arg0 process) (arg1 event-message-block))
"Constructs an [[attack-info]] according to the projectile's `options`"
(if (not (and (-> (the-as drill-barons-ship (-> obj parent 0)) next-state)
(= (-> (the-as drill-barons-ship (-> obj parent 0)) next-state name) 'hidden)
)
)
((method-of-type guard-shot deal-damage!) obj arg0 arg1)
#f
)
)
(defun drill-ship-shot-move ((arg0 drill-ship-shot))
(guard-shot-move arg0)
0
(none)
)
(defmethod init-proj-settings! drill-ship-shot ((obj drill-ship-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) obj)
(set! (-> obj attack-mode) 'drill-ship-shot)
(set! (-> obj move) guard-shot-move)
(set! (-> obj max-speed) 737280.0)
(set! (-> obj timeout) (seconds 4.167))
(none)
)
;; NOTE: decompiled by hand
;; TODO make the decompiler work on static data of this type
;; (define *drill-ship-turret-speed-event* (the-as turret-path-event L183))
(define *drill-ship-turret-speed-event*
(new 'static 'turret-path-event
:pos 0.0
:event-type 'set-speed-mult
:param (new 'static 'boxed-array :type int32 #x140)
)
)
(defstate idle (drill-barons-ship-explode)
:virtual #t
:code (behavior ()
(ja-no-eval :group! (ja-group)
:num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(none)
)
:post (the-as (function none :behavior drill-barons-ship-explode) ja-post)
)
(defstate hidden (drill-barons-ship)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('trigger-back)
(set! (-> self pass) 1)
(dotimes (gp-0 (length *ship-turrets-first-pass*))
(set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* gp-0) alive) #f)
)
(go-virtual idle)
)
(('trigger)
(go-virtual idle)
)
(('pass-complete?)
(when (>= (-> self pass) 2)
(task-node-close! (game-task-node drill-ship-resolution))
(set-continue! *game-info* "drillmid-ship-warp" #f)
(talker-spawn-func (-> *talker-speech* 102) *entity-pool* (target-pos 0) (the-as region #f))
)
#t
)
)
)
:enter (behavior ()
(set! (-> self from-y) (-> self current-y-position))
(set! (-> self inc-y) 3276.8)
(set! (-> self ease-y) 40960.0)
(when (> (-> self pass) 0)
(let ((a0-2 (the-as turret (process-by-name
(if (= (-> self pass) 1)
"turret-14"
"turret-15"
)
*active-pool*
)
)
)
)
(if a0-2
(base-turret-method-39 a0-2 *drill-ship-turret-speed-event*)
)
)
)
(none)
)
:code (behavior ()
(cond
((>= (-> self pass) 2)
(set! (-> self current-y-position) -1024000.0)
(let* ((gp-0 (get-process *default-dead-pool* drill-barons-ship-explode #x4000))
(v1-3 (when gp-0
(let ((t9-1 (method-of-type drill-barons-ship-explode activate))
(a0-1 gp-0)
(a1-1 self)
(a2-3 (symbol->string (-> drill-barons-ship-explode symbol)))
)
(t9-1 (the-as drill-barons-ship-explode a0-1) a1-1 a2-3 (the-as pointer #x70004000))
(run-now-in-process gp-0 drill-barons-ship-explode-init-by-other (the-as none a2-3))
)
(-> gp-0 ppointer)
)
)
)
(change-parent (-> v1-3 0) *entity-pool*)
)
(until (task-node-closed? (game-task-node drill-ship-resolution))
(suspend)
)
(cleanup-for-death self)
)
(else
(until #f
(ja :num-func num-func-identity :frame-num 0.0)
(suspend)
)
#f
)
)
(none)
)
:post (behavior ()
(set! (-> self current-y-position)
(seek-ease-in-out
(-> self current-y-position)
(-> self from-y)
-1024000.0
(* (-> self inc-y) (-> self clock time-adjust-ratio))
(-> self ease-y)
(-> self ease-y)
(* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y))
)
)
(set! (-> self root-override trans y)
(+ (-> self current-y-position)
(* 4096.0 (* 2.0 (sin (+ 16384.0 (* 45.511112 (the float (-> self clock frame-counter)))))))
)
)
(drill-barons-ship-method-22 self)
(transform-post)
(none)
)
)
(defstate idle (drill-barons-ship)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('pass-complete?)
(set! (-> self end-of-pass) #t)
#f
)
)
)
)
:enter (behavior ()
(set-setting! 'music 'danger4 0 0)
(let ((v1-2 2)
(a0-2 (+ (-> self pass) 1))
)
(set! (-> self pass) a0-2)
(if (= a0-2 v1-2)
(quaternion-rotate-local-y! (-> self init-quat) (-> self init-quat) 32768.0)
)
)
(set! (-> self inc-y) 2048.0)
(set! (-> self ease-y) 40960.0)
(set! (-> self end-of-pass) #f)
(none)
)
:exit (behavior ()
(remove-setting! 'music)
(none)
)
:code (behavior ()
(until #f
(ja :num-func num-func-identity :frame-num 0.0)
(suspend)
)
#f
(none)
)
:post (behavior ()
(let ((gp-0 (if (= (-> self pass) 1)
*ship-turrets-first-pass*
*ship-turrets-second-pass*
)
)
)
(let* ((s5-0 (-> *barons-ship-turrets* (-> gp-0 (-> self next-to-shoot-idx))))
(f30-0 (if (= (-> self pass) 1)
0.0
40960.0
)
)
(f28-0 (+ f30-0 (-> s5-0 ship-y-offset)))
)
(cond
((and (not (-> s5-0 next-to-shoot)) (= (-> self current-y-position) f28-0))
(let ((s4-0 1)
(s3-0 (-> self next-to-shoot-idx))
(s5-1 (-> self next-to-shoot-idx))
)
(while (and (not (-> *barons-ship-turrets* (-> gp-0 (mod (+ s3-0 s4-0) (length gp-0))) alive))
(< s4-0 (+ (length gp-0) 1))
)
(+! s4-0 1)
)
(set! (-> self next-to-shoot-idx) (mod (+ s3-0 s4-0) (length gp-0)))
(let ((v1-35 (-> *barons-ship-turrets* (-> gp-0 (-> self next-to-shoot-idx)))))
(when (-> v1-35 alive)
(cond
((= s5-1 (-> self next-to-shoot-idx))
(set! (-> v1-35 next-to-shoot) (the-as basic #t))
)
(else
(set! (-> self from-y) (-> self current-y-position))
(let ((f0-6 (fabs (- (+ f30-0 (-> v1-35 ship-y-offset)) (-> self from-y)))))
(set! (-> self inc-y) (* 0.02 f0-6))
(set! (-> self ease-y) (* 0.2 f0-6))
)
)
)
)
)
)
)
(else
(set! (-> self current-y-position)
(seek-ease-in-out
(-> self current-y-position)
(-> self from-y)
f28-0
(* (-> self inc-y) (-> self clock time-adjust-ratio))
(-> self ease-y)
(-> self ease-y)
(* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y))
)
)
(if (and (= (-> self current-y-position) f28-0) (-> s5-0 alive))
(set! (-> s5-0 next-to-shoot) (the-as basic #t))
)
)
)
)
(let ((s5-2 #t))
(dotimes (s4-2 (length gp-0))
(if (-> *barons-ship-turrets* (-> gp-0 s4-2) alive)
(set! s5-2 #f)
)
)
(if s5-2
(go-virtual hidden)
)
)
)
(set! (-> self root-override trans y)
(+ (-> self current-y-position)
(* 4096.0 (* 2.0 (sin (+ 16384.0 (* 45.511112 (the float (-> self clock frame-counter)))))))
)
)
(drill-barons-ship-method-22 self)
(+! (-> self x-offset-angle) (* 0.7 (-> self clock time-adjust-ratio)))
(transform-post)
(none)
)
)
(defmethod drill-barons-ship-method-22 drill-barons-ship ((obj drill-barons-ship))
(with-pp
(quaternion-rotate-local-x!
(-> obj root-override quat)
(-> obj init-quat)
(* 182.04445 (sin (* 36.40889 (the float (-> pp clock frame-counter)))))
)
(let ((f30-2 (* 182.04445 (* 5.0 (sin (* 45.511112 (the float (-> pp clock frame-counter))))))))
(when (!= (-> obj rock-angle) 0.0)
(+! f30-2 (* 182.04445 (* 20.0
(if (= (-> obj pass) 1)
1.0
-1.0
)
(sin (* 182.04445 (-> obj rock-angle)))
)
)
)
(set! (-> obj rock-angle)
(seek-ease
(-> obj rock-angle)
0.0
(* 5.0 (-> pp clock time-adjust-ratio))
90.0
(* 0.1 (-> pp clock time-adjust-ratio))
)
)
)
(quaternion-rotate-local-z! (-> obj root-override quat) (-> obj root-override quat) f30-2)
)
(set! (-> obj root-override trans z)
(+ (* 4096.0 (* 30.0 (cos (* 45.511112 (the float (-> pp clock frame-counter)))))) (if (= (-> obj pass) 1)
-1433600.0
-1433600.0
)
)
)
(if *target*
(set! (-> obj root-override trans x)
(+ (-> *target* control trans x) (* 4096.0 (+ (if (= (-> obj pass) 1)
15.0
-35.0
)
(* 40.0 (sin (* 182.04445 (-> obj x-offset-angle))))
)
)
)
)
)
0
(none)
)
)
(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((obj drill-barons-ship-turret))
(with-pp
(vector<-cspace!
(-> obj root-override trans)
(-> (the-as drill-barons-ship (-> obj parent 0)) node-list data (-> obj info joint-idx))
)
(let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> obj info init-y-angle))))
(quaternion*!
(-> obj root-override quat)
(-> (the-as drill-barons-ship (-> obj parent 0)) root-override quat)
a2-1
)
)
(when (-> obj jmod)
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root-override trans)))
(s3-0 (quaternion->matrix (new-stack-matrix0) (-> obj root-override quat)))
)
(vector-normalize! s5-1 1.0)
(let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 1) 1.0))
(s3-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 2) 1.0))
(a0-13 (vector-normalize! (vector-flatten! (new 'stack-no-clear 'vector) s5-1 s4-0) 1.0))
(f30-0 (vector-y-angle a0-13))
(f0-1 (vector-y-angle s3-1))
(f0-5 (fmax
(fmin (+ (deg-diff f0-1 f30-0) (* 182.04445 (-> obj error-y-angle))) (-> obj info twist-y-max))
(- (-> obj info twist-y-max))
)
)
)
(quaternion-axis-angle! (the-as quaternion (-> obj jmod twist)) 0.0 1.0 0.0 f0-5)
)
)
(if (-> obj jmod-left)
(quaternion-axis-angle!
(the-as quaternion (-> obj jmod-left twist))
0.0
0.0
1.0
(* 182.04445 (* -3.0 (the float (-> pp clock frame-counter))))
)
)
(if (-> obj jmod-right)
(quaternion-axis-angle!
(the-as quaternion (-> obj jmod-right twist))
0.0
0.0
1.0
(* 182.04445 (* 3.0 (the float (-> pp clock frame-counter))))
)
)
)
0
(none)
)
)
(defstate dead (drill-barons-ship-turret)
:virtual #t
:enter (behavior ()
(let ((v1-1 (-> self root-override root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(set! (-> self state-time) (-> self clock frame-counter))
(none)
)
:trans (behavior ()
(vector<-cspace!
(-> self root-override trans)
(-> (the-as drill-barons-ship (-> self parent 0)) node-list data (-> self info joint-idx))
)
(let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> self info init-y-angle))))
(quaternion*!
(-> self root-override quat)
(-> (the-as drill-barons-ship (-> self parent 0)) root-override quat)
a2-1
)
)
(if (and (-> (the-as drill-barons-ship (-> self parent 0)) next-state)
(= (-> (the-as drill-barons-ship (-> self parent 0)) next-state name) 'hidden)
)
(go-virtual going-down)
)
(none)
)
:code (behavior ()
(until #f
(ja :num-func num-func-identity :frame-num 0.0)
(suspend)
)
#f
(none)
)
:post (behavior ()
(transform-post)
(none)
)
)
(defstate going-down (drill-barons-ship-turret)
:virtual #t
:enter (behavior ()
(cond
((>= (-> (the-as drill-barons-ship (-> self parent 0)) pass) 2)
(when (zero? (-> self info mesh))
(let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000)))
(when gp-0
(let ((t9-1 (method-of-type part-tracker activate)))
(t9-1
(the-as part-tracker gp-0)
*entity-pool*
(symbol->string (-> part-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((t9-2 run-function-in-process)
(a0-2 gp-0)
(a1-2 part-tracker-init)
(a2-4 (-> *part-group-id-table* 469))
(a3-1 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> self root-override trans quad))
((the-as (function object object object object object object object object none) t9-2)
a0-2
a1-2
a2-4
a3-1
t0-0
t1-0
t2-0
t3-0
)
)
(-> gp-0 ppointer)
)
)
)
)
((zero? (-> self info mesh))
(process-spawn
part-tracker
:init part-tracker-init
(-> *part-group-id-table* 466)
0
#f
#f
self
3
:to *entity-pool*
)
)
(else
(let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when gp-2
(let ((t9-7 (method-of-type part-tracker activate)))
(t9-7
(the-as part-tracker gp-2)
*entity-pool*
(symbol->string (-> part-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((t9-8 run-function-in-process)
(a0-8 gp-2)
(a1-8 part-tracker-init)
(a2-14 (-> *part-group-id-table* 469))
(a3-5 0)
(t0-2 #f)
(t1-2 #f)
(t2-2 #f)
(t3-2 *launch-matrix*)
)
(set! (-> t3-2 trans quad) (-> self root-override trans quad))
((the-as (function object object object object object object object object none) t9-8)
a0-8
a1-8
a2-14
a3-5
t0-2
t1-2
t2-2
t3-2
)
)
(-> gp-2 ppointer)
)
)
)
)
(none)
)
:trans (behavior ()
(vector<-cspace!
(-> self root-override trans)
(-> (the-as drill-barons-ship (-> self parent 0)) node-list data (-> self info joint-idx))
)
(if (not (and (-> (the-as drill-barons-ship (-> self parent 0)) next-state)
(= (-> (the-as drill-barons-ship (-> self parent 0)) next-state name) 'hidden)
)
)
(go-virtual dead)
)
(none)
)
:code (behavior ()
(until #f
(ja :num-func num-func-identity :frame-num 0.0)
(suspend)
)
#f
(none)
)
:post (behavior ()
(transform-post)
(none)
)
)
(defun calculate-ship-projectile-velocity ((arg0 projectile-init-by-other-params) (arg1 float))
(let* ((s4-0 *target*)
(a0-2 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(cond
(a0-2
(let ((a0-3 (get-trans a0-2 0)))
(set-vector!
(-> arg0 vel)
0.0
(+ (- 6144.0 (-> arg0 pos y)) (-> a0-3 y))
(vector-vector-xz-distance a0-3 (-> arg0 pos))
1.0
)
)
(vector-normalize! (-> arg0 vel) 1.0)
)
(else
(set-vector! (-> arg0 vel) 0.0 0.0 1.0 1.0)
)
)
)
(vector-rotate-y! (-> arg0 vel) (-> arg0 vel) arg1)
(vector-normalize! (-> arg0 vel) 737280.0)
0
(none)
)
(defstate attack (drill-barons-ship-turret)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('attack)
(when (and (-> self info alive) (= (-> self anim-frame) 1.0))
(+! (-> self hit-count) 1)
(cond
((!= (-> self hit-count) 20)
(sound-play "ship-gun-hit")
)
(else
(set! (-> self info alive) #f)
(set! (-> self info next-to-shoot) #f)
(let ((gp-1 (new 'stack-no-clear 'vector)))
(set! (-> gp-1 quad) (-> self root-override trans quad))
(set! (-> gp-1 z) (+ 81920.0 (-> gp-1 z)))
(let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when s5-1
(let ((t9-3 (method-of-type part-tracker activate)))
(t9-3
(the-as part-tracker s5-1)
*entity-pool*
(symbol->string (-> part-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((t9-4 run-function-in-process)
(a0-7 s5-1)
(a1-4 part-tracker-init)
(a2-6 (-> *part-group-id-table* 469))
(a3-3 0)
(t0-1 #f)
(t1-1 #f)
(t2-1 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> gp-1 quad))
((the-as (function object object object object object object object object none) t9-4)
a0-7
a1-4
a2-6
a3-3
t0-1
t1-1
t2-1
t3-0
)
)
(-> s5-1 ppointer)
)
)
)
(sound-play "shp-turret-xplo")
(cond
((= (-> self info mesh) 1)
(setup-masks (-> self draw) 0 1)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 468) 0 #f #f self 3 :to self)
)
((= (-> self info mesh) 2)
(setup-masks (-> self draw) 0 1)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 467) 0 #f #f self 3 :to self)
)
(else
(setup-masks (-> self draw) 0 1)
(process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 466) 0 #f #f self 3 :to self)
)
)
(sound-play "ship-veer")
(set! (-> (the-as drill-barons-ship (-> self parent 0)) rock-angle) 180.0)
(go-virtual dead)
)
)
)
)
)
)
:enter (behavior ()
(set! (-> self shot-timer) (-> self clock frame-counter))
(set! (-> self shot-counter) 0)
(set! (-> self error-y-angle) (if (< 25.0 (rand-vu-float-range 0.0 50.0))
-15.0
15.0
)
)
(set! (-> self error-y-angle-dest) (- (-> self error-y-angle)))
(let ((v1-5 (-> self root-override root-prim)))
(set! (-> v1-5 prim-core collide-as) (-> self root-override backup-collide-as))
(set! (-> v1-5 prim-core collide-with) (-> self root-override backup-collide-with))
)
(cond
((= (-> self info mesh) 1)
(process-spawn
part-tracker
:init part-tracker-init
(-> *part-group-id-table* 460)
0
#f
#f
self
3
:to *entity-pool*
)
)
((= (-> self info mesh) 2)
(process-spawn
part-tracker
:init part-tracker-init
(-> *part-group-id-table* 459)
0
#f
#f
self
3
:to *entity-pool*
)
)
(else
(process-spawn
part-tracker
:init part-tracker-init
(-> *part-group-id-table* 458)
0
#f
#f
self
3
:to *entity-pool*
)
)
)
(if (zero? (-> self info mesh))
(set! (-> self soundid) (sound-play "ship-gun1-chain"))
)
(none)
)
:exit (behavior ()
(if (zero? (-> self info mesh))
(sound-stop (-> self soundid))
)
(let ((v1-5 (-> self root-override root-prim)))
(set! (-> v1-5 prim-core collide-as) (collide-spec))
(set! (-> v1-5 prim-core collide-with) (collide-spec))
)
0
(cond
((= (-> self info mesh) 1)
(sound-play "ship-gun2-down")
)
((= (-> self info mesh) 2)
(sound-play "ship-gun3-close")
)
(else
(sound-play "ship-gun1-down")
)
)
(none)
)
:code (behavior ()
(cond
((= (-> self info mesh) 1)
(sound-play "ship-gun2-up")
)
((= (-> self info mesh) 2)
(sound-play "ship-gun3-open")
)
(else
(sound-play "ship-gun1-up")
)
)
(until #f
(seek! (-> self anim-frame) 1.0 (* 0.01 (-> self clock time-adjust-ratio)))
(let ((v1-12 (-> self skel root-channel 0)))
(set! (-> v1-12 num-func) num-func-identity)
(let ((f0-4 (-> self anim-frame))
(a0-13 (cond
((= (-> self info mesh) 1)
3.0
)
((= (-> self info mesh) 2)
10.0
)
(else
11.0
)
)
)
)
(set! (-> v1-12 frame-num) (* f0-4 a0-13))
)
)
(suspend)
)
#f
(none)
)
:post (behavior ()
(drill-barons-ship-turret-method-24 self)
(if (and (-> (the-as drill-barons-ship (-> self parent 0)) next-state)
(= (-> (the-as drill-barons-ship (-> self parent 0)) next-state name) 'hidden)
)
(go-virtual idle)
)
(when (and (= (-> self anim-frame) 1.0) (>= (- (-> self clock frame-counter) (-> self shot-timer)) (seconds 0.2)))
(let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params)))
(cond
((-> self jmod)
(let* ((a1-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> self jmod twist))))
(v1-23 (quaternion->matrix (new-stack-matrix0) a1-1))
(f30-0 (vector-y-angle (-> v1-23 vector 2)))
)
(set! (-> gp-0 ent) #f)
(set! (-> gp-0 charge) 1.0)
(set! (-> gp-0 options) (projectile-options))
(set! (-> gp-0 notify-handle) (the-as handle #f))
(set! (-> gp-0 owner-handle) (the-as handle #f))
(set! (-> gp-0 ignore-handle) (process->handle self))
(let* ((v1-28 *game-info*)
(a0-11 (+ (-> v1-28 attack-id) 1))
)
(set! (-> v1-28 attack-id) a0-11)
(set! (-> gp-0 attack-id) a0-11)
)
(set! (-> gp-0 timeout) (seconds 4))
(cond
((zero? (-> self info mesh))
(cond
((not (logtest? (-> self shot-counter) 1))
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 13))
(calculate-ship-projectile-velocity gp-0 f30-0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
(else
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 14))
(calculate-ship-projectile-velocity gp-0 f30-0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
)
)
((not (logtest? (-> self shot-counter) 1))
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 9))
(calculate-ship-projectile-velocity gp-0 f30-0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
(else
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 11))
(calculate-ship-projectile-velocity gp-0 f30-0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
)
)
)
(else
(let ((v1-45 (quaternion->matrix (new-stack-matrix0) (-> self root-override quat)))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> v1-45 vector 2 quad))
(vector-normalize! s5-0 1.0)
(vector-normalize-copy! (-> gp-0 vel) s5-0 737280.0)
)
(set! (-> gp-0 ent) #f)
(set! (-> gp-0 charge) 1.0)
(set! (-> gp-0 options) (projectile-options))
(set! (-> gp-0 notify-handle) (the-as handle #f))
(set! (-> gp-0 owner-handle) (the-as handle #f))
(set! (-> gp-0 ignore-handle) (process->handle self))
(let* ((v1-52 *game-info*)
(a0-32 (+ (-> v1-52 attack-id) 1))
)
(set! (-> v1-52 attack-id) a0-32)
(set! (-> gp-0 attack-id) a0-32)
)
(set! (-> gp-0 timeout) (seconds 4))
(cond
((not (logtest? (-> self shot-counter) 1))
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 6))
(calculate-ship-projectile-velocity gp-0 0.0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
(else
(vector<-cspace! (-> gp-0 pos) (-> self node-list data 5))
(calculate-ship-projectile-velocity gp-0 0.0)
(spawn-projectile drill-ship-shot gp-0 self *default-dead-pool*)
)
)
)
)
)
(sound-play "ship-gun1-fire")
(+! (-> self shot-counter) 1)
(set! (-> self shot-timer) (-> self clock frame-counter))
(seek! (-> self error-y-angle) (-> self error-y-angle-dest) (-> self clock time-adjust-ratio))
(if (= (-> self error-y-angle) (-> self error-y-angle-dest))
(set! (-> self info next-to-shoot) #f)
)
)
(if (= (-> self error-y-angle) (-> self error-y-angle-dest))
(go-virtual idle)
)
(transform-post)
(none)
)
)
(defstate idle (drill-barons-ship-turret)
:virtual #t
:enter (behavior ()
(set! (-> self hit-count) 0)
0
(none)
)
:code (behavior ()
(until #f
(seek! (-> self anim-frame) 0.0 (* 0.01 (-> self clock time-adjust-ratio)))
(let ((v1-4 (-> self skel root-channel 0)))
(set! (-> v1-4 num-func) num-func-identity)
(let ((f0-4 (-> self anim-frame))
(a0-3 (cond
((= (-> self info mesh) 1)
3.0
)
((= (-> self info mesh) 2)
10.0
)
(else
11.0
)
)
)
)
(set! (-> v1-4 frame-num) (* f0-4 a0-3))
)
)
(suspend)
)
#f
(none)
)
:post (behavior ()
(cond
((-> self info alive)
(drill-barons-ship-turret-method-24 self)
(if (-> self info next-to-shoot)
(go-virtual attack)
)
)
(else
(go-virtual dead)
)
)
(transform-post)
(none)
)
)