jak-project/goal_src/jak2/levels/fortress/fort-turret.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

1138 lines
41 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: fort-turret.gc
;; name in dgo: fort-turret
;; dgos: FDA, FRB
;; DECOMP BEGINS
(defpartgroup group-fort-turret-hit
:id 685
:duration (seconds 3)
:linger-duration (seconds 1)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 15)
:parts ((sp-item 3049 :period 1500 :length 25 :offset -10)
(sp-item 3050 :fade-after (meters 60) :period 1500 :length 30)
(sp-item 3051 :fade-after (meters 60) :falloff-to (meters 60) :period 1500 :length 100)
(sp-item 3052 :fade-after (meters 200) :falloff-to (meters 200) :period 1500 :length 50)
(sp-item 3053 :period 1500 :length 5 :offset -10)
(sp-item 3054 :fade-after (meters 150) :falloff-to (meters 150) :period 1500 :length 50)
)
)
(defpart 3052
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc))
(sp-rnd-flt spt-num 1.0 1.0 1.0)
(sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-rot-z)
:flags (sp-flag spflag7)
:random-rangef 65536.0
:random-multf 1.0
)
(sp-rnd-flt spt-scale-y (meters 0.8) (meters 0.2) 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.02) (meters 0.01) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.01) (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.22068965)
(sp-flt spt-friction 0.95)
(sp-int spt-timer 1000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(sp-func spt-func 'sparticle-motion-blur)
(sp-int-plain-rnd spt-next-time 25 4 1)
(sp-launcher-by-id spt-next-launcher 3055)
(new 'static 'sp-field-init-spec
:field (sp-field-id spt-conerot-x)
:flags (sp-flag from-pointer)
:func '*sp-temp*
)
)
)
(defpart 3054
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc))
(sp-rnd-flt spt-num 1.0 1.0 1.0)
(sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0)
(sp-flt spt-rot-z (degrees 0.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 0.0)
(sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.13333334) 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.36)
(sp-flt spt-fade-b -4.24)
(sp-flt spt-fade-a 0.22068965)
(sp-flt spt-friction 0.95)
(sp-int spt-timer 1000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(sp-int-plain-rnd spt-next-time 25 4 1)
(sp-launcher-by-id spt-next-launcher 3055)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
)
)
(defpart 3055
: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 3056)
)
)
(defpart 3056
: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 3057)
)
)
(defpart 3057
: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.094444446)
(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 3058)
)
)
(defpart 3058
:init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0))
)
(defpart 3053
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc))
(sp-flt spt-num 1.0)
(sp-flt spt-scale-x (meters 5))
(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.5))
(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 100)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)
(sp-int spt-next-time 50)
(sp-launcher-by-id spt-next-launcher 3059)
)
)
(defpart 3059
:init-specs ((sp-flt spt-scalevel-x (meters -0.2))
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-r 0.0)
(sp-flt spt-fade-g -2.56)
(sp-flt spt-fade-b 0.0)
(sp-flt spt-fade-a -1.92)
)
)
(defpart 3051
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc))
(sp-rnd-flt spt-num 5.0 3.0 1.0)
(sp-flt spt-x (meters 0.25))
(sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 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 16.0 48.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.083333336) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0016666667) 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 -0.68266666 -1.3653333 1.0)
(sp-flt spt-friction 0.87)
(sp-int spt-timer 1000)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
(sp-int-plain-rnd spt-next-time 35 14 1)
(sp-launcher-by-id spt-next-launcher 3060)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
)
)
(defpart 3060
: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 3061)
)
)
(defpart 3061
:init-specs ((sp-flt spt-fade-r -0.5543478) (sp-flt spt-fade-g -0.5543478) (sp-flt spt-fade-a -0.13913043))
)
(defpart 3049
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc))
(sp-rnd-flt spt-num 3.0 1.0 1.0)
(sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0)
(sp-rnd-flt spt-scale-x (meters 2) (meters 1.5) 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) (meters 0.1) 1.0)
(sp-rnd-flt spt-scalevel-x (meters 0.033333335) (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-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.88)
(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 3062)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
)
)
(defpart 3062
: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 3063)
)
)
(defpart 3063
: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 3050
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc))
(sp-rnd-flt spt-num 4.0 2.0 1.0)
(sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.25) 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 0.2) (meters 0.1) 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.13333334) (meters 0.02) 1.0)
(sp-flt spt-fade-g 1.6)
(sp-flt spt-fade-b 3.2)
(sp-flt spt-fade-a -1.6)
(sp-int spt-timer 80)
(sp-cpuinfo-flags sp-cpuinfo-flag-2)
)
)
(defpart 3064
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb))
(sp-func spt-birth-func 'birth-func-laser-pointer)
(sp-flt spt-num 1.0)
(sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.05) 1.0)
(sp-flt spt-scale-y (meters 40))
(sp-flt spt-r 255.0)
(sp-flt spt-g 0.0)
(sp-copy-from-other spt-b -1)
(sp-flt spt-a 20.0)
(sp-int spt-timer 5)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)
)
)
(defpart 3065
: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 0.2) (meters 0.15) 1.0)
(sp-flt spt-rot-x 204.8)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 255.0)
(sp-rnd-flt spt-g 128.0 128.0 1.0)
(sp-copy-from-other spt-b -1)
(sp-flt spt-a 128.0)
(sp-flt spt-rotvel-z (degrees 0.3))
(sp-int spt-timer 5)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)
(sp-flt spt-userdata 1.0)
)
)
(defpart 3066
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc))
(sp-flt spt-num 1.0)
(sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0)
(sp-flt spt-rot-x 204.8)
(sp-copy-from-other spt-scale-y -4)
(sp-rnd-flt spt-r 128.0 128.0 1.0)
(sp-flt spt-g 0.0)
(sp-copy-from-other spt-b -1)
(sp-rnd-flt spt-a 48.0 16.0 1.0)
(sp-flt spt-rotvel-z (degrees 0.3))
(sp-int spt-timer 5)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)
(sp-flt spt-userdata 1.0)
)
)
(defpart 3067
: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 0.2) (meters 0.025) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-rnd-flt spt-r 128.0 128.0 1.0)
(sp-flt spt-g 32.0)
(sp-copy-from-other spt-b -1)
(sp-flt spt-a 128.0)
(sp-flt spt-rotvel-z (degrees 0.3))
(sp-flt spt-fade-g -1.0666667)
(sp-flt spt-fade-b -1.0666667)
(sp-flt spt-fade-a -8.533334)
(sp-int spt-timer 5)
(sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)
)
)
(defun fort-turret-draw-laser-spot ((arg0 vector) (arg1 object) (arg2 symbol))
(new 'stack-no-clear 'vector)
(cond
(arg2
(let ((t9-0 sp-launch-particles-var)
(a0-1 *sp-particle-system-2d*)
(a1-1 (-> *part-id-table* 3066))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> arg0 quad))
(t9-0 a0-1 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-1 sp-launch-particles-var)
(a0-2 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 3065))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> arg0 quad))
(t9-1 a0-2 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
(else
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-3 (-> *part-id-table* 3067))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> arg0 quad))
(t9-2 a0-3 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
0
(none)
)
(defun fort-turret-draw-laser ((arg0 vector) (arg1 vector))
(let* ((s4-0 (-> *part-id-table* 3064))
(s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-scale-x)))
(f30-0 (-> s3-0 initial-valuef))
(f28-0 (-> s3-0 random-rangef))
)
(let ((f0-4 (fmin 1.0 (fmax 0.0 (* 0.000015287453 (+ -122.88 (vector-vector-distance (camera-pos) arg0)))))))
(set! (-> s3-0 initial-valuef) (* f30-0 f0-4))
(set! (-> s3-0 random-rangef) (* f28-0 f0-4))
)
(draw-beam s4-0 arg0 (vector-! (new 'stack-no-clear 'vector) arg1 arg0) #t #t)
(set! (-> s3-0 initial-valuef) f30-0)
(set! (-> s3-0 random-rangef) f28-0)
)
0
(none)
)
(defskelgroup skel-fort-turret fort-turret fort-turret-lod0-jg fort-turret-idle-ja
((fort-turret-lod0-mg (meters 999999)))
:bounds (static-spherem 8 11.25 0 16.5)
:shadow fort-turret-shadow-mg
:origin-joint-index 3
:shadow-joint-index 3
)
(defskelgroup skel-fort-turret-explode fort-turret fort-turret-explode-lod0-jg fort-turret-explode-idle-ja
((fort-turret-explode-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 15)
)
(define *fort-turret-exploder-params*
(new 'static 'joint-exploder-static-params
:joints (new 'static 'boxed-array :type joint-exploder-static-joint-params
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1)
)
:collide-spec #x1
)
)
(deftype fort-turret (enemy)
((gun-tilt-jm joint-mod :offset-assert 532)
(gun-shadow-jm joint-mod :offset-assert 536)
(aim-pos vector :inline :offset-assert 544)
(target-bullseye vector :inline :offset-assert 560)
(gun-twist float :offset-assert 576)
(gun-tilt float :offset-assert 580)
(desired-twist float :offset-assert 584)
(desired-tilt float :offset-assert 588)
(los-clear symbol :offset-assert 592)
(flash-state basic :offset-assert 596)
(flash-index uint32 :offset-assert 600)
(can-shoot symbol :offset-assert 604)
(last-hit-time time-frame :offset-assert 608)
(init-mat matrix :inline :offset-assert 624)
(target-timeout uint64 :offset-assert 688)
(beam-intersect basic :offset-assert 696)
(sync sync-linear :inline :offset-assert 704)
(invincible symbol :offset-assert 720)
)
:heap-base #x260
:method-count-assert 143
:size-assert #x2d4
:flag-assert #x8f026002d4
(:methods
(attack () _type_ :state 137)
(sweep () _type_ :state 138)
(fort-turret-method-139 (_type_) none 139)
(fort-turret-method-140 (_type_ float float) quaternion 140)
(fort-turret-method-141 (_type_) vector 141)
(fort-turret-method-142 (_type_ symbol int) symbol 142)
)
)
(define *fort-turret-enemy-info*
(new 'static 'enemy-info
:use-die-falling #f
: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 'array idle-control-frame 4
(new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x1)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
)
:idle-anim 4
:notice-anim 4
:hostile-anim 4
:hit-anim 4
:knocked-anim -1
:knocked-land-anim -1
:die-anim 4
:die-falling-anim -1
:victory-anim -1
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint -1
:notice-distance (meters 150)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 150)
:default-hit-points 1
: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
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 2730.6667
:knocked-soft-vxz-lo 72089.6
:knocked-soft-vxz-hi 108134.4
:knocked-soft-vy-lo 81920.0
:knocked-soft-vy-hi 122880.0
:knocked-medium-vxz-lo 147456.0
:knocked-medium-vxz-hi 196608.0
:knocked-medium-vy-lo 135168.0
:knocked-medium-vy-hi 151552.0
:knocked-hard-vxz-lo 78643.2
:knocked-hard-vxz-hi 117964.8
:knocked-hard-vy-lo 183500.8
:knocked-hard-vy-hi 209715.2
:knocked-huge-vxz-lo 164659.2
:knocked-huge-vxz-hi 249036.8
:knocked-huge-vy-lo 183500.8
:knocked-huge-vy-hi 217907.2
:knocked-yellow-vxz-lo 40960.0
:knocked-yellow-vxz-hi 49152.0
:knocked-yellow-vy-lo 57344.0
:knocked-yellow-vy-hi 81920.0
:knocked-red-vxz-lo 24576.0
:knocked-red-vxz-hi 196608.0
:knocked-red-vy-lo 94208.0
:knocked-red-vy-hi 151552.0
:knocked-blue-vxz-lo 40960.0
:knocked-blue-vxz-hi 49152.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 81920.0
:shadow-size (meters 1)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint -1
:gem-offset (new 'static 'sphere :r 163840.0)
)
)
(set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(defmethod track-target! fort-turret ((obj fort-turret))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type enemy track-target!)))
(t9-0 obj)
)
(let ((s5-0 (-> obj root-override2)))
(update-transforms s5-0)
(pull-riders! s5-0)
(do-push-aways s5-0)
)
(when (not (and (-> obj next-state) (= (-> obj next-state name) 'die)))
(let ((a0-7 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))))
(fort-turret-draw-laser a0-7 (-> obj target-bullseye))
)
(case (-> obj beam-intersect)
(('target)
(fort-turret-draw-laser-spot (-> obj target-bullseye) #f #t)
)
(('wall)
(fort-turret-draw-laser-spot (-> obj target-bullseye) #f #f)
)
)
)
(none)
)
;; WARN: Return type mismatch quaternion vs none.
(defmethod fort-turret-method-139 fort-turret ((obj fort-turret))
(let ((a0-2 (handle->process (-> obj focus handle))))
(if a0-2
(set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad))
)
)
(let ((s4-0 (new 'stack-no-clear 'vector))
(s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4)))
)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(vector-! s4-0 (-> obj aim-pos) (-> obj root-override2 trans))
(vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1))
(vector-normalize! s4-0 1.0)
(set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0)))
(set! (-> obj desired-twist) (fmin 9102.223 (fmax -9102.223 (-> obj desired-twist))))
(cond
((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0))
)
((< (-> obj desired-twist) 0.0)
(set! (-> obj desired-twist) -9102.223)
)
(else
(set! (-> obj desired-twist) 9102.223)
)
)
(set! (-> obj desired-tilt) 0.0)
(when (< (fabs (-> obj desired-twist)) 9102.223)
(vector-normalize-copy! s3-0 (-> obj node-list data 3 bone transform vector 1) 1.0)
(vector-! s4-0 (-> obj aim-pos) s5-2)
(set! (-> obj desired-tilt)
(- (atan 8192.0 (vector-normalize-ret-len! s4-0 1.0)) (asin (vector-dot s3-0 s4-0)))
)
(set! (-> obj desired-tilt) (fmin 8192.0 (fmax -8192.0 (-> obj desired-tilt))))
)
)
(vector-normalize-copy!
(-> obj aim-pos)
(-> obj node-list data 4 bone transform vector 2)
(vector-vector-distance s5-2 (-> obj aim-pos))
)
)
(vector+!
(-> obj aim-pos)
(-> obj aim-pos)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7))
)
(fort-turret-method-140 obj 0.3 364.0889)
(none)
)
(defmethod fort-turret-method-140 fort-turret ((obj fort-turret) (arg0 float) (arg1 float))
(rider-trans)
(let ((s3-0 (new 'stack-no-clear 'matrix)))
(+! (-> obj gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-twist) (-> obj gun-twist))))))
(matrix-rotate-y! s3-0 (-> obj gun-twist))
(matrix*! s3-0 s3-0 (-> obj init-mat))
(matrix->quaternion (-> obj root-override2 quat) s3-0)
)
(+! (-> obj gun-tilt) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-tilt) (-> obj gun-tilt))))))
(quaternion-axis-angle! (-> obj gun-tilt-jm quat) 1.0 0.0 0.0 (-> obj gun-tilt))
)
(defmethod fort-turret-method-141 fort-turret ((obj fort-turret))
(with-pp
(let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12)))
(v1-3
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 12 bone transform vector 2) 1.0)
)
(s4-1 (vector-float*! (new 'stack-no-clear 'vector) v1-3 163840.0))
)
(let ((s3-0 (new 'stack-no-clear 'collide-query)))
(set! (-> s3-0 start-pos quad) (-> s5-0 quad))
(set! (-> s3-0 move-dist quad) (-> s4-1 quad))
(let ((v1-6 s3-0))
(set! (-> v1-6 radius) 409.6)
(set! (-> v1-6 collide-with)
(collide-spec backgnd jak crate obstacle hit-by-player-list hit-by-others-list player-list pusher)
)
(set! (-> v1-6 ignore-process0) obj)
(set! (-> v1-6 ignore-process1) #f)
(set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-6 action-mask) (collide-action solid))
)
(let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* s3-0)))
(cond
((>= f30-0 0.0)
(set! (-> obj beam-intersect) (the-as basic 'wall))
(when (-> s3-0 best-other-tri collide-ptr)
(let* ((s3-1 (-> s3-0 best-other-tri collide-ptr))
(a0-14 (if (type? s3-1 collide-shape-prim)
(the-as collide-shape-prim s3-1)
)
)
)
(when a0-14
(when (= (-> a0-14 cshape process type) target)
(set! (-> obj target-timeout) (the-as uint (-> pp clock frame-counter)))
(set! (-> obj beam-intersect) (the-as basic 'target))
)
)
)
)
(vector-float*! s4-1 s4-1 f30-0)
(let ((s3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 s4-1))
(a0-21 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 10)))
(v1-23 (-> obj gun-shadow-jm twist-max))
)
(set! (-> v1-23 z)
(+ 2.0 (* 0.00024414062 (vector-length (vector-! (new 'stack-no-clear 'vector) s3-3 a0-21))))
)
(if (= (-> obj beam-intersect) 'wall)
(set! (-> v1-23 z) (+ -5.0 (-> v1-23 z)))
)
)
)
(else
(set! (-> obj beam-intersect) (the-as basic 'nothing))
)
)
)
)
(vector+! (-> obj target-bullseye) s5-0 s4-1)
)
)
)
(defmethod fort-turret-method-142 fort-turret ((obj fort-turret) (arg0 symbol) (arg1 int))
(let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1)))
(s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))
)
(let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) v1-2))
(f30-0 (/ 2013265900.0 (vector-length s2-1)))
(s3-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 ent) (-> obj entity))
(set! (-> s4-0 charge) 1.0)
(set! (-> s4-0 options) (projectile-options))
(set! (-> s4-0 pos quad) (-> v1-2 quad))
(set! (-> s4-0 notify-handle) (process->handle obj))
(set! (-> s4-0 owner-handle) (the-as handle #f))
(set! (-> s4-0 ignore-handle) (process->handle obj))
(let* ((v1-10 *game-info*)
(a0-18 (+ (-> v1-10 attack-id) 1))
)
(set! (-> v1-10 attack-id) a0-18)
(set! (-> s4-0 attack-id) a0-18)
)
(set! (-> s4-0 timeout) (seconds 4))
(vector-normalize-copy! (-> s4-0 vel) s2-1 491520.0)
(let ((f30-1 (fmin 16384.0 f30-0)))
(set-vector! s3-0 (-> s2-1 z) (-> s2-1 y) (- (-> s2-1 x)) 1.0)
(vector-normalize! s3-0 (rand-vu-float-range (- f30-1) f30-1))
(vector+! (-> s4-0 vel) (-> s4-0 vel) s3-0)
(vector-cross! s3-0 s3-0 (-> s4-0 vel))
(vector-normalize! s3-0 (rand-vu-float-range (- f30-1) f30-1))
)
(vector+! (-> s4-0 vel) (-> s4-0 vel) s3-0)
)
(spawn-projectile guard-shot s4-0 obj *default-dead-pool*)
)
(sound-play "turret-shot")
(if arg0
(sound-play "gtur-shot-fire")
)
(let ((v0-11 #t))
(set! (-> obj flash-state) (the-as basic v0-11))
v0-11
)
)
(defstate attack (fort-turret)
:virtual #t
:event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler)
:exit (behavior ()
(set! (-> self flash-state) #f)
(none)
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self reaction-time))
(if (>= 2 (the-as int (-> self focus aware)))
(go-stare self)
)
)
(set! (-> self root-override2 penetrated-by) (get-penetrate-info self))
(fort-turret-method-141 self)
(if (or (>= (- (-> self clock frame-counter) (the-as int (-> self target-timeout))) (seconds 0.5))
(< (- (-> self clock frame-counter) (-> self last-hit-time)) (seconds 2))
)
(go-virtual hostile)
)
(fort-turret-method-139 self)
(none)
)
:code (behavior ()
(sound-play "turret-up")
(ja-no-eval :group! fort-turret-rise-ja
:num! (seek! (the float (+ (-> (the-as art-joint-anim fort-turret-rise-ja) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((gp-1 (-> self clock frame-counter)))
(until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.5))
(suspend)
)
)
(until #f
(let ((gp-2 7))
(sound-play "gturret")
(dotimes (s5-2 3)
(cond
((not (-> self can-shoot))
)
(else
(fort-turret-method-142 self #t gp-2)
)
)
(ja-no-eval :group! fort-turret-shoot-ja
:num! (seek! (the float (+ (-> (the-as art-joint-anim fort-turret-shoot-ja) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((s4-1 (-> self clock frame-counter)))
(until (>= (- (-> self clock frame-counter) s4-1) (seconds 0.33))
(suspend)
)
)
(if (= gp-2 7)
(set! gp-2 8)
(set! gp-2 9)
)
)
)
(set! (-> self flash-state) #f)
(let ((gp-3 (-> self clock frame-counter)))
(until (>= (- (-> self clock frame-counter) gp-3) (seconds 1.5))
(suspend)
)
)
)
#f
(none)
)
:post (behavior ()
(when (-> self flash-state)
(set-fordumpa-turret-flash! (the-as int (-> self flash-index)))
(set-forrescb-turret-flash! (the-as int (-> self flash-index)))
)
(enemy-simple-post)
(none)
)
)
(defstate sweep (fort-turret)
:virtual #t
:event (the-as (function process int symbol event-message-block object :behavior fort-turret) enemy-event-handler)
:enter (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(none)
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self reaction-time))
(if (>= 2 (the-as int (-> self focus aware)))
(go-stare self)
)
)
(set! (-> self root-override2 penetrated-by) (get-penetrate-info self))
(set! (-> self desired-twist) (* 8192.0 (cos (get-scaled-val! (-> self sync) 32768.0 0))))
(fort-turret-method-140 self 0.1 91.022224)
(fort-turret-method-141 self)
(if (and (< (- (-> self clock frame-counter) (the-as int (-> self target-timeout))) (seconds 0.5))
(>= (- (-> self clock frame-counter) (-> self last-hit-time)) (seconds 2))
)
(go-virtual attack)
)
(none)
)
:code (behavior ()
(sleep-code)
(none)
)
:post (the-as (function none :behavior fort-turret) enemy-simple-post)
)
(defstate hostile (fort-turret)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type enemy hostile) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self desired-tilt) 0.0)
(set! (-> self desired-twist) 0.0)
(ja-channel-push! 1 (seconds 0.5))
(ja :group! fort-turret-idle-ja)
(none)
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self reaction-time))
(if (>= 2 (the-as int (-> self focus aware)))
(go-stare self)
)
)
(set! (-> self root-override2 penetrated-by) (get-penetrate-info self))
(fort-turret-method-141 self)
(if (and (< (- (-> self clock frame-counter) (the-as int (-> self target-timeout))) (seconds 0.5))
(>= (- (-> self clock frame-counter) (-> self last-hit-time)) (seconds 2))
)
(go-virtual attack)
)
(set! (-> self desired-twist) (* 8192.0 (cos (get-scaled-val! (-> self sync) 32768.0 0))))
(fort-turret-method-140 self 0.1 91.022224)
(if (and (< (fabs (-> self gun-twist)) 364.0889) (< (fabs (-> self gun-tilt)) 364.0889))
(go-virtual sweep)
)
(none)
)
:code (behavior ()
(sleep-code)
(none)
)
)
(defmethod general-event-handler fort-turret ((obj fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(with-pp
(if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*))
(set! (-> obj last-hit-time) (-> pp clock frame-counter))
)
(case arg2
(('start)
(let ((v0-0 (the-as object #t)))
(set! (-> obj can-shoot) (the-as symbol v0-0))
v0-0
)
)
(('stop)
(set! (-> obj can-shoot) #f)
#f
)
(('attack)
(cond
((= (-> arg0 type) target)
#f
)
((-> obj invincible)
#f
)
(else
((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
(else
((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
)
(defstate die (fort-turret)
:virtual #t
:enter (behavior ()
(dispose! self)
(let ((v1-3 (-> self root-override2 root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
)
0
(set! (-> self hit-points) 0)
0
(none)
)
:code (behavior ()
(let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0))))
(process-spawn
joint-exploder
(art-group-get-by-name *level* "skel-fort-turret-explode" (the-as (pointer uint32) #f))
9
gp-0
*fort-turret-exploder-params*
:to self
)
)
(activate! *camera-smush-control* 409.6 18 210 1.0 0.995 (-> self clock))
(sound-play "turret-explode")
(suspend)
(ja-channel-set! 0)
(let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))
(s5-2 (-> self clock frame-counter))
)
(until (>= (- (-> self clock frame-counter) s5-2) (seconds 2))
(spawn (-> self part) gp-2)
(suspend)
)
)
(let ((gp-3 (-> self clock frame-counter)))
(until (>= (- (-> self clock frame-counter) gp-3) (seconds 1))
(suspend)
)
)
(send-event self 'death-end)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
(none)
)
:post (behavior ()
(track-target! self)
(none)
)
)
(defmethod coin-flip? fort-turret ((obj fort-turret))
"@returns The result of a 50/50 RNG roll"
#f
)
;; WARN: Return type mismatch int vs penetrate.
(defmethod get-penetrate-info fort-turret ((obj fort-turret))
"@returns the allowed way(s) this enemy can take damage
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
(the-as penetrate 0)
)
(defmethod init-enemy-collision! fort-turret ((obj fort-turret))
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
(stack-size-set! (-> obj main-thread) 512)
(let ((s5-0 (new 'process 'collide-shape-moving obj (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))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0)))
(set! (-> s5-0 total-prims) (the-as uint 4))
(set! (-> s4-0 prim-core collide-as) (collide-spec enemy pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list))
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
(set! (-> s4-0 transform-index) 4)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 36864.0)
(set! (-> s5-0 root-prim) s4-0)
)
(pusher-init s5-0)
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-17 prim-core action) (collide-action solid rideable))
(set! (-> v1-17 transform-index) 6)
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 5120.0 14336.0)
)
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-19 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-19 prim-core action) (collide-action solid rideable))
(set! (-> v1-19 transform-index) 5)
(set-vector! (-> v1-19 local-sphere) 0.0 6144.0 0.0 12288.0)
)
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-21 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-21 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-21 prim-core action) (collide-action solid rideable))
(set! (-> v1-21 transform-index) 3)
(set-vector! (-> v1-21 local-sphere) 0.0 24576.0 0.0 24576.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-24 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with))
)
(set! (-> obj root-override2) s5-0)
)
0
(none)
)
;; WARN: Return type mismatch enemy vs fort-turret.
(defmethod relocate fort-turret ((obj fort-turret) (arg0 int))
(if (nonzero? (-> obj gun-tilt-jm))
(&+! (-> obj gun-tilt-jm) arg0)
)
(if (nonzero? (-> obj gun-shadow-jm))
(&+! (-> obj gun-shadow-jm) arg0)
)
(the-as fort-turret ((method-of-type enemy relocate) obj arg0))
)
(defmethod init-enemy! fort-turret ((obj fort-turret))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-fort-turret" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(init-enemy-behaviour-and-stats! obj *fort-turret-enemy-info*)
(set! (-> obj invincible) #f)
(if (logtest? (the-as int (res-lump-value (-> obj entity) 'enemy-options uint128 :time -1000000000.0)) 1)
(set! (-> obj invincible) #t)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj enemy-flags) (enemy-flag notice))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 685) obj))
(set! (-> obj gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4))
(set! (-> obj gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local obj 10 #f #f #t)))
(set! (-> obj gun-shadow-jm twist-min-y) (the-as float #t))
(set! (-> obj los-clear) #f)
(set! (-> obj gun-twist) 0.0)
(set! (-> obj gun-tilt) 0.0)
(set! (-> obj desired-twist) 0.0)
(set! (-> obj desired-tilt) 0.0)
(set! (-> obj flash-state) #f)
(set! (-> obj can-shoot) #t)
(set! (-> obj last-hit-time) 0)
(set! (-> obj target-timeout) (the-as uint 0))
(let ((a1-7 (new 'stack-no-clear 'sync-info-params)))
(let ((v1-21 0))
(if #t
(set! v1-21 (logior v1-21 1))
)
(set! (-> a1-7 sync-type) 'sync-linear)
(set! (-> a1-7 sync-flags) (the-as sync-flags v1-21))
)
(set! (-> a1-7 entity) (-> obj entity))
(set! (-> a1-7 period) (the-as uint 3000))
(set! (-> a1-7 percent) 0.0)
(initialize! (-> obj sync) a1-7)
)
(set! (-> obj flash-index) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0))
(quaternion->matrix (-> obj init-mat) (-> obj root-override2 quat))
(set-vector! (-> obj gun-shadow-jm twist-max) 2.0 1.0 10.0 1.0)
(let ((v1-32 (new 'static 'shadow-control :settings (new 'static 'shadow-settings
:flags (shadow-flags shdf02 shdf03 shdf04 shdf07)
:shadow-dir (new 'static 'vector :y -1.0 :w -983040.0)
:bot-plane (new 'static 'plane :y -1.0 :w 32358.4)
:top-plane (new 'static 'plane :y -1.0 :w 49152.0)
:fade-dist 409600.0
)
)
)
)
(-> v1-32 settings)
(set! (-> v1-32 settings shadow-type) 1)
(set! (-> obj draw shadow-ctrl) v1-32)
)
0
(none)
)