2022-06-30 01:22:51 -04:00
|
|
|
;;-*-Lisp-*-
|
|
|
|
(in-package goal)
|
|
|
|
|
|
|
|
;; name: under-obs.gc
|
|
|
|
;; name in dgo: under-obs
|
|
|
|
;; dgos: UNB
|
|
|
|
|
2022-08-05 16:12:54 -04:00
|
|
|
;; DECOMP BEGINS
|
|
|
|
|
2023-01-28 16:02:58 -05:00
|
|
|
(defpartgroup group-bubbler-streams
|
|
|
|
:id 500
|
|
|
|
:bounds (static-bspherem 0 8 0 16)
|
|
|
|
:parts ((sp-item 2197 :flags (is-3d bit6))
|
|
|
|
(sp-item 2198 :flags (bit6))
|
|
|
|
(sp-item 2199 :fade-after (meters 80) :falloff-to (meters 160))
|
|
|
|
(sp-item 2200 :flags (is-3d bit6))
|
2023-04-29 11:01:47 -04:00
|
|
|
(sp-item 2201 :fade-after (meters 160) :falloff-to (meters 40) :period (seconds 3.3) :length (seconds 0.017) :binding 2195)
|
|
|
|
(sp-item 2201 :fade-after (meters 160) :falloff-to (meters 40) :period (seconds 4.6) :length (seconds 0.017) :binding 2195)
|
|
|
|
(sp-item 2201 :fade-after (meters 160) :falloff-to (meters 40) :period (seconds 6.7) :length (seconds 0.017) :binding 2195)
|
|
|
|
(sp-item 2201 :fade-after (meters 160) :falloff-to (meters 40) :period (seconds 13.1) :length (seconds 0.017) :binding 2195)
|
|
|
|
(sp-item 2201 :fade-after (meters 160) :falloff-to (meters 40) :period (seconds 2) :length (seconds 0.017) :binding 2195)
|
2023-01-28 16:02:58 -05:00
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2195 :flags (bit1 start-dead launch-asap) :binding 2196)
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2196 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit1 start-dead))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
(sp-item 2202 :fade-after (meters 100) :falloff-to (meters 100))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2199
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #xc9 :page #xc))
|
|
|
|
(:num 8.0)
|
|
|
|
(:x (meters 0) (meters 2.7))
|
|
|
|
(:y (meters 0) (meters 32))
|
|
|
|
(:scale-x (meters 0.25))
|
|
|
|
(:scale-y (meters 0.25) (meters 0.1))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 255.0)
|
|
|
|
(:a 0.0)
|
|
|
|
(:vel-y (meters 0.0016666667) (meters 0.0016666667))
|
|
|
|
(:fade-a 0.4)
|
|
|
|
(:timer (seconds 0.535))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
|
|
|
|
(:next-time (seconds 0.267))
|
|
|
|
(:next-launcher 2203)
|
|
|
|
(:rotate-y (degrees 0) (degrees 3600))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2203
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:fade-a -0.4))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2197
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #xd3 :page #xc))
|
|
|
|
(:birth-func 'birth-func-camera-orient)
|
|
|
|
(:num 1.0)
|
|
|
|
(:y (meters 299))
|
|
|
|
(:scale-x (meters 6))
|
|
|
|
(:rot-x (degrees 90))
|
|
|
|
(:rot-z (degrees 0))
|
|
|
|
(:scale-y (meters 600))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 0.0 128.0)
|
|
|
|
(:a 32.0 4.0)
|
|
|
|
(:timer (seconds 0.017))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2200
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #xc9 :page #xc))
|
|
|
|
(:num 1.0)
|
|
|
|
(:y (meters 0.1))
|
|
|
|
(:scale-x (meters 16))
|
|
|
|
(:scale-y :copy scale-x)
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 0.0 128.0)
|
|
|
|
(:a 128.0)
|
|
|
|
(:timer (seconds 0.017))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2198
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #xca :page #xc))
|
|
|
|
(:num 1.0)
|
|
|
|
(:y (meters 1))
|
|
|
|
(:scale-x (meters 12) (meters 0.1))
|
|
|
|
(:rot-x (degrees 33.75))
|
|
|
|
(:scale-y (meters 20) (meters 0.1))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 0.0 128.0)
|
|
|
|
(:a 20.0)
|
|
|
|
(:timer (seconds 0.017))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
|
|
|
|
(:userdata 16384.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2202
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #x21 :page #xc))
|
|
|
|
(:num 0.1)
|
|
|
|
(:x (meters -0.5) (meters 1.5))
|
|
|
|
(:scale-x (meters 0.3) (meters 0.15))
|
|
|
|
(:scale-y (meters 0.2) (meters 0.1))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 255.0)
|
|
|
|
(:a 0.0)
|
|
|
|
(:vel-y (meters 0.016666668) (meters 0.01))
|
|
|
|
(:fade-a 0.16)
|
|
|
|
(:timer (seconds 16))
|
|
|
|
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
|
|
(:userdata 0.0)
|
|
|
|
(:func 'check-water-level-above-and-die)
|
|
|
|
(:next-time (seconds 0.33) (seconds 0.657))
|
|
|
|
(:next-launcher 2204)
|
|
|
|
(:rotate-y (degrees 0) (degrees 3600))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2204
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:fade-a 0.0) (:next-time (seconds 1) (seconds 5.997)) (:next-launcher 2205))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2205
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:scalevel-x (meters -0.00033333333) (meters -0.00066666666))
|
|
|
|
(:scalevel-y :copy scalevel-x)
|
|
|
|
(:fade-a -0.16)
|
|
|
|
(:accel-y (meters -0.0001) (meters -0.0001))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2201
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #x21 :page #xc))
|
|
|
|
(:num 1.0)
|
|
|
|
(:scale-x (meters 0.3))
|
|
|
|
(:scale-y :copy scale-x)
|
|
|
|
(:r 0.0)
|
|
|
|
(:a 128.0)
|
|
|
|
(:vel-y (meters 0.016666668) (meters 0.01))
|
|
|
|
(:timer (seconds 10))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
|
|
(:rotate-y (degrees 0))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2195
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #x21 :page #xc))
|
|
|
|
(:num 1.0)
|
|
|
|
(:x (meters 0) (meters 16))
|
|
|
|
(:y (meters 0) (meters 16))
|
|
|
|
(:z (meters 0.1))
|
|
|
|
(:scale-x (meters 1.5))
|
|
|
|
(:scale-y (meters 0.9))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 255.0)
|
|
|
|
(:a 0.0)
|
|
|
|
(:omega (degrees 0))
|
|
|
|
(:vel-x (meters -0.21333334) 1 (meters 0.42666668))
|
|
|
|
(:vel-y (meters 0))
|
|
|
|
(:vel-z (meters 0))
|
|
|
|
(:scalevel-x (meters -0.0050000004))
|
|
|
|
(:scalevel-y (meters 0.0016666667))
|
|
|
|
(:fade-a 1.6)
|
|
|
|
(:timer (seconds 8) (seconds 1.997))
|
|
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch))
|
|
|
|
(:userdata 0.0)
|
|
|
|
(:func 'check-water-level-above-and-die)
|
|
|
|
(:next-time (seconds 0.1))
|
|
|
|
(:next-launcher 2206)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2206
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:scale-x (meters 1.2))
|
|
|
|
(:scale-y (meters 1))
|
|
|
|
(:scalevel-x (meters 0.010000001))
|
|
|
|
(:scalevel-y (meters -0.0033333334))
|
|
|
|
(:fade-a 0.0)
|
|
|
|
(:next-time (seconds 0.1))
|
|
|
|
(:next-launcher 2207)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2207
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:scale-x (meters 1.5))
|
|
|
|
(:scale-y (meters 0.9))
|
|
|
|
(:scalevel-x (meters -0.010000001))
|
|
|
|
(:scalevel-y (meters 0.0033333334))
|
|
|
|
(:next-time (seconds 0.1))
|
|
|
|
(:next-launcher 2206)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2196
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:texture (new 'static 'texture-id :index #x21 :page #xc))
|
|
|
|
(:num 0.0 0.5)
|
|
|
|
(:x (meters -0.25) (meters 0.5))
|
|
|
|
(:y (meters 0.1))
|
|
|
|
(:z (meters -0.25) (meters 0.5))
|
|
|
|
(:scale-x (meters 0.3) (meters 0.1))
|
|
|
|
(:scale-y (meters 0.2) (meters 0.1))
|
|
|
|
(:r 255.0)
|
|
|
|
(:g 255.0)
|
|
|
|
(:b 255.0)
|
|
|
|
(:a 0.0)
|
|
|
|
(:scalevel-x (meters -0.00033333333) (meters -0.00066666666))
|
|
|
|
(:scalevel-y :copy scalevel-x)
|
|
|
|
(:fade-a 0.53333336)
|
|
|
|
(:timer (seconds 8))
|
|
|
|
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
|
|
|
|
(:userdata 0.0)
|
|
|
|
(:func 'check-water-level-above-and-die)
|
|
|
|
(:next-time (seconds 0.017))
|
|
|
|
(:next-launcher 2208)
|
|
|
|
(:conerot-x (degrees 110) (degrees 50.000004))
|
|
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
|
|
(:conerot-radius (meters 0.4))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2208
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:vel-y (meters 0.013333334) (meters 0.0033333334))
|
|
|
|
(:accel-y (meters -0.00006666667))
|
|
|
|
(:next-time (seconds 0.25))
|
|
|
|
(:next-launcher 2209)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpart 2209
|
2023-04-29 11:01:47 -04:00
|
|
|
:init-specs ((:fade-a -0.08))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(deftype bubbler (process-drawable)
|
2023-10-29 23:20:02 -04:00
|
|
|
((rod-of-god-scale float)
|
|
|
|
(ambient-id sound-id)
|
|
|
|
(last-recharge-time time-frame)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
|
|
|
hidden
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defstate hidden (bubbler)
|
|
|
|
:virtual #t
|
|
|
|
:trans (behavior ()
|
|
|
|
(if (send-event (ppointer->process *underb-master*) 'query 'bubbler)
|
|
|
|
(go-virtual idle)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (bubbler)
|
|
|
|
:virtual #t
|
2023-09-22 05:54:49 -04:00
|
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
|
|
(case message
|
2023-01-28 16:02:58 -05:00
|
|
|
(('untrigger)
|
|
|
|
(go-virtual idle)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(if (not (send-event (ppointer->process *underb-master*) 'query 'bubbler))
|
|
|
|
(go-virtual hidden)
|
|
|
|
)
|
|
|
|
(set! (-> *part-id-table* 2197 init-specs 4 initial-valuef) (* 16384.0 (-> self rod-of-god-scale)))
|
|
|
|
(set! (-> *part-id-table* 2197 init-specs 8 initial-valuef) 0.0)
|
|
|
|
(set! (-> *part-id-table* 2197 init-specs 9 initial-valuef) 96.0)
|
|
|
|
(set! (-> *part-id-table* 2197 init-specs 10 initial-valuef) 255.0)
|
|
|
|
(set! (-> *part-id-table* 2200 init-specs 3 initial-valuef) (* 65536.0 (-> self rod-of-god-scale)))
|
|
|
|
(set! (-> *part-id-table* 2200 init-specs 2 initial-valuef) 3686.4)
|
|
|
|
(set! (-> *part-id-table* 2200 init-specs 5 initial-valuef) 0.0)
|
|
|
|
(set! (-> *part-id-table* 2200 init-specs 6 initial-valuef) 96.0)
|
|
|
|
(set! (-> *part-id-table* 2200 init-specs 7 initial-valuef) 255.0)
|
|
|
|
(set! (-> *part-id-table* 2198 init-specs 9 initial-valuef) (* 25.0 (-> self rod-of-god-scale)))
|
|
|
|
(set! (-> *part-id-table* 2198 init-specs 6 initial-valuef) 0.0)
|
|
|
|
(set! (-> *part-id-table* 2198 init-specs 7 initial-valuef) 96.0)
|
|
|
|
(set! (-> *part-id-table* 2198 init-specs 8 initial-valuef) 255.0)
|
|
|
|
(spawn (-> self part) (-> self root trans))
|
2023-06-14 17:04:00 -04:00
|
|
|
(sound-play "bubbler" :id (-> self ambient-id) :position (-> self root trans))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((a0-4 *target*))
|
|
|
|
(when a0-4
|
|
|
|
(let ((a0-5 (get-trans a0-4 0)))
|
|
|
|
(when (and (>= (- (-> a0-5 y) (-> self root trans y)) -6144.0)
|
|
|
|
(let ((f0-18 11264.0))
|
|
|
|
(>= (* f0-18 f0-18) (vector-vector-xz-distance-squared a0-5 (-> self root trans)))
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(if (time-elapsed? (-> self last-recharge-time) (seconds 1))
|
2023-01-28 16:02:58 -05:00
|
|
|
(sound-play "oxygen-recharge")
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set-time! (-> self last-recharge-time))
|
2023-01-28 16:02:58 -05:00
|
|
|
(send-event (ppointer->process *underb-master*) 'bubbler)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod deactivate ((this bubbler))
|
2023-09-26 10:17:00 -04:00
|
|
|
(sound-stop (-> this ambient-id))
|
|
|
|
((method-of-type process-drawable deactivate) this)
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this bubbler) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) (new 'process 'trsqv))
|
|
|
|
(process-drawable-from-entity! this arg0)
|
|
|
|
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 500) this))
|
|
|
|
(set! (-> this rod-of-god-scale) 1.0)
|
|
|
|
(set! (-> this ambient-id) (sound-play "bubbler" :position (-> this root trans)))
|
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-rise-plat (process-drawable)
|
2023-10-29 23:20:02 -04:00
|
|
|
((up-y float)
|
|
|
|
(down-y float)
|
|
|
|
(delta-y float)
|
|
|
|
(up-threshold float)
|
|
|
|
(down-threshold float)
|
|
|
|
(last-ridden time-frame)
|
|
|
|
(ridden symbol)
|
|
|
|
(rider-started basic)
|
|
|
|
(extra-id int32)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle-up
|
|
|
|
wait-up
|
|
|
|
going-down
|
|
|
|
idle-down
|
|
|
|
wait-down
|
|
|
|
going-up
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-rise-plat under-rise-plat under-rise-plat-lod0-jg under-rise-plat-idle-ja
|
|
|
|
((under-rise-plat-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 2 0 14)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defbehavior under-rise-plat-event-handler under-rise-plat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
|
|
(case arg2
|
|
|
|
(('ridden)
|
|
|
|
(set! (-> self ridden) #t)
|
2023-05-18 16:33:46 -04:00
|
|
|
(let ((v0-0 (the-as object (current-time))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> self last-ridden) (the-as time-frame v0-0))
|
|
|
|
v0-0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(('big-room)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'status (-> arg3 param 0))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate wait-up (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(set! (-> self rider-started) #f)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #t)
|
|
|
|
)
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(when (not (-> self ridden))
|
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #f)
|
|
|
|
)
|
|
|
|
(go-virtual idle-up)
|
|
|
|
)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle-up (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(if (-> self ridden)
|
|
|
|
(go-virtual going-down)
|
|
|
|
)
|
|
|
|
(let* ((a0-1 (target-pos 0))
|
|
|
|
(v1-6 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) a0-1))
|
|
|
|
)
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> v1-6 y) 58000.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(if (< (-> self down-threshold) (-> v1-6 y))
|
|
|
|
(go-virtual going-down)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate going-down (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
|
|
(set! (-> self root transv y) -20480.0)
|
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'up #f)
|
|
|
|
)
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(let ((gp-0 (-> self root)))
|
|
|
|
(if (>= (-> self down-y) (-> gp-0 trans y))
|
|
|
|
(go-virtual wait-down)
|
|
|
|
)
|
|
|
|
(vector-v++! (-> gp-0 trans) (-> gp-0 transv))
|
|
|
|
(if (>= (-> self down-y) (-> gp-0 trans y))
|
|
|
|
(set! (-> gp-0 trans y) (-> self down-y))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate wait-down (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(set! (-> self rider-started) #f)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(when (not (-> self ridden))
|
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #f)
|
|
|
|
)
|
|
|
|
(go-virtual idle-down)
|
|
|
|
)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle-down (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(when (-> self ridden)
|
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #t)
|
|
|
|
)
|
|
|
|
(set! (-> self rider-started) (the-as basic #t))
|
|
|
|
(go-virtual going-up)
|
|
|
|
)
|
|
|
|
(let* ((a0-4 (target-pos 0))
|
|
|
|
(v1-19 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) a0-4))
|
|
|
|
)
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> v1-19 y) 58000.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(if (< (-> v1-19 y) (-> self up-threshold))
|
|
|
|
(go-virtual going-up)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate going-up (under-rise-plat)
|
|
|
|
:virtual #t
|
|
|
|
:event under-rise-plat-event-handler
|
|
|
|
:enter (behavior ()
|
|
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
|
|
(set! (-> self root transv y) 20480.0)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(rider-trans)
|
|
|
|
(when (-> self rider-started)
|
2023-09-26 10:17:00 -04:00
|
|
|
(when (and (not (-> self ridden)) (time-elapsed? (-> self last-ridden) (seconds 2)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(if (= (-> self extra-id) 1)
|
|
|
|
(send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #f)
|
|
|
|
)
|
|
|
|
(go-virtual going-down)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(set! (-> self ridden) #f)
|
|
|
|
(let ((gp-0 (-> self root)))
|
|
|
|
(if (>= (-> gp-0 trans y) (-> self up-y))
|
|
|
|
(go-virtual wait-up)
|
|
|
|
)
|
|
|
|
(vector-v++! (-> gp-0 trans) (-> gp-0 transv))
|
|
|
|
(if (>= (-> gp-0 trans y) (-> self up-y))
|
|
|
|
(set! (-> gp-0 trans y) (-> self up-y))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post rider-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-rise-plat) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
|
|
|
(local-vars (sv-16 res-tag))
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
|
|
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
|
|
|
|
(set! (-> s3-0 transform-index) 3)
|
|
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 -40960.0 0.0 57344.0)
|
|
|
|
(set! (-> s4-0 total-prims) (the-as uint 1))
|
|
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
|
|
)
|
|
|
|
(pusher-init s4-0)
|
|
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-12 (-> s4-0 root-prim)))
|
|
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
|
|
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) s4-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(process-drawable-from-entity! this arg0)
|
|
|
|
(-> this root)
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! sv-16 (new 'static 'res-tag))
|
|
|
|
(let ((v1-16 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16))))
|
|
|
|
(when v1-16
|
2023-09-26 10:17:00 -04:00
|
|
|
(+! (-> this root trans x) (-> v1-16 0))
|
|
|
|
(+! (-> this root trans y) (-> v1-16 1))
|
|
|
|
(+! (-> this root trans z) (-> v1-16 2))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this extra-id) (res-lump-value arg0 'extra-id int :time -1000000000.0))
|
|
|
|
(set! (-> this delta-y) (res-lump-float arg0 'height :default 92160.0))
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-rise-plat" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((v1-23 (-> this root)))
|
|
|
|
(set! (-> this down-y) (-> v1-23 trans y))
|
|
|
|
(+! (-> v1-23 trans y) (-> this delta-y))
|
|
|
|
(set! (-> this up-y) (-> v1-23 trans y))
|
|
|
|
(set! (-> this down-threshold) (* 0.6666667 (-> this delta-y)))
|
|
|
|
(set! (-> this up-threshold) (- (-> this down-threshold)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(vector-reset! (-> v1-23 transv))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this ridden) #f)
|
|
|
|
(set! (-> this rider-started) #f)
|
|
|
|
(set! (-> this draw light-index) (the-as uint 2))
|
|
|
|
(go (method-of-object this idle-up))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-buoy-base (process-drawable)
|
2023-10-29 23:20:02 -04:00
|
|
|
((release symbol)
|
|
|
|
(open-anim-frame float)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
|
|
|
opened
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-buoy-base under-buoy-base under-buoy-base-lod0-jg under-buoy-base-idle-ja
|
|
|
|
((under-buoy-base-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 2 0 5)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-buoy-base)
|
|
|
|
:virtual #t
|
2023-09-22 05:54:49 -04:00
|
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
|
|
(case message
|
2023-01-28 16:02:58 -05:00
|
|
|
(('attack)
|
2023-09-22 05:54:49 -04:00
|
|
|
(case (-> (the-as attack-info (-> block param 1)) mode)
|
2023-01-28 16:02:58 -05:00
|
|
|
(('mech-punch 'crush)
|
|
|
|
(let ((a0-5 (ppointer->process (-> self parent))))
|
|
|
|
(send-event a0-5 'base-hit)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(('release)
|
|
|
|
(let ((v0-0 (the-as object #t)))
|
|
|
|
(set! (-> self release) (the-as symbol v0-0))
|
|
|
|
v0-0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(when (-> self release)
|
|
|
|
(ja :num-func num-func-identity :frame-num (-> self open-anim-frame))
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> self open-anim-frame) 0.2)
|
2023-01-28 16:02:58 -05:00
|
|
|
(if (< 17.0 (-> self open-anim-frame))
|
|
|
|
(go-virtual opened)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate opened (under-buoy-base)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
|
|
(defbehavior under-buoy-base-init-by-other under-buoy-base ((arg0 object) (arg1 entity-actor))
|
|
|
|
(process-entity-set! self arg1)
|
|
|
|
(let ((s5-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player))))
|
|
|
|
(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 obstacle))
|
|
|
|
(set! (-> s4-0 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> s4-0 transform-index) 3)
|
|
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0)
|
|
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
|
|
)
|
|
|
|
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
|
|
|
|
(set! (-> v1-8 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-8 transform-index) 4)
|
|
|
|
(set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 20480.0)
|
|
|
|
)
|
|
|
|
(let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
|
|
|
|
(set! (-> v1-10 prim-core collide-as) (collide-spec obstacle))
|
|
|
|
(set! (-> v1-10 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-10 transform-index) 5)
|
|
|
|
(set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 20480.0)
|
|
|
|
)
|
|
|
|
(let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0))))
|
|
|
|
(set! (-> v1-12 prim-core collide-as) (collide-spec obstacle))
|
|
|
|
(set! (-> v1-12 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-12 transform-index) 6)
|
|
|
|
(set-vector! (-> v1-12 local-sphere) 0.0 8192.0 0.0 20480.0)
|
|
|
|
)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-15 (-> s5-0 root-prim)))
|
|
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as))
|
|
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with))
|
|
|
|
)
|
|
|
|
(set! (-> self root) s5-0)
|
|
|
|
)
|
|
|
|
(initialize-skeleton
|
|
|
|
self
|
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-base" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
|
|
|
(process-drawable-from-entity! self arg1)
|
|
|
|
(set! (-> self release) #f)
|
|
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
|
|
(set! (-> self draw light-index) (the-as uint 2))
|
|
|
|
(cond
|
|
|
|
((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete)))
|
|
|
|
(set! (-> self open-anim-frame) 17.0)
|
2023-10-06 10:42:16 -04:00
|
|
|
(ja-no-eval :group! under-buoy-base-idle-ja :num! (identity (-> self open-anim-frame)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(go-virtual opened)
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(set! (-> self open-anim-frame) 0.0)
|
2023-10-06 10:42:16 -04:00
|
|
|
(ja-no-eval :group! under-buoy-base-idle-ja :num! (identity (-> self open-anim-frame)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(go-virtual idle)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-buoy-chain (process-drawable)
|
|
|
|
()
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-buoy-chain under-buoy-chain under-buoy-chain-lod0-jg under-buoy-chain-idle-ja
|
|
|
|
((under-buoy-chain-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 -10 0 14)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-buoy-chain)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(let ((v1-0 (ppointer->process (-> self parent))))
|
|
|
|
(set! (-> self root trans quad) (-> (the-as process-drawable v1-0) root trans quad))
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
|
|
(defbehavior under-buoy-chain-init-by-other under-buoy-chain ((arg0 object) (arg1 entity-actor))
|
|
|
|
(process-entity-set! self arg1)
|
|
|
|
(let ((s5-0 (new 'process 'collide-shape-moving self (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> v1-6 prim-core collide-as) (collide-spec obstacle))
|
|
|
|
(set! (-> v1-6 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-6 transform-index) 4)
|
|
|
|
(set-vector! (-> v1-6 local-sphere) 0.0 -40960.0 0.0 57344.0)
|
|
|
|
(set! (-> s5-0 total-prims) (the-as uint 1))
|
|
|
|
(set! (-> s5-0 root-prim) v1-6)
|
|
|
|
)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-9 (-> s5-0 root-prim)))
|
|
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as))
|
|
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with))
|
|
|
|
)
|
|
|
|
(set! (-> self root) s5-0)
|
|
|
|
)
|
|
|
|
(process-drawable-from-entity! self arg1)
|
|
|
|
(initialize-skeleton
|
|
|
|
self
|
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-chain" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
|
|
|
(set! (-> self draw light-index) (the-as uint 2))
|
|
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
|
|
(go-virtual idle)
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-buoy-plat (rigid-body-platform)
|
2023-10-29 23:20:02 -04:00
|
|
|
((orig-trans vector :inline)
|
|
|
|
(surface-height float)
|
|
|
|
(anchor-point vector :inline)
|
|
|
|
(base (pointer under-buoy-base))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
waiting
|
|
|
|
running
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-buoy-plat under-buoy-plat under-buoy-plat-lod0-jg under-buoy-plat-idle-ja
|
|
|
|
((under-buoy-plat-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 2 0 5)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod rigid-body-object-method-29 ((this under-buoy-plat) (arg0 float))
|
2023-09-30 11:06:09 -04:00
|
|
|
(call-parent-method this arg0)
|
2023-09-26 10:17:00 -04:00
|
|
|
(rigid-body-platform-method-56 this (-> this orig-trans))
|
2023-01-28 16:02:58 -05:00
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod allocate-and-init-cshape ((this under-buoy-plat))
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(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-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
|
|
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec jak hit-by-others-list 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 8192.0 0.0 20480.0)
|
|
|
|
(set! (-> s5-0 total-prims) (the-as uint 1))
|
|
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
|
|
)
|
|
|
|
(pusher-init s5-0)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-16 (-> s5-0 root-prim)))
|
|
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as))
|
|
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) s5-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-02-04 20:36:30 -05:00
|
|
|
(define *under-buoy-plat-platform-constants*
|
|
|
|
(new 'static 'rigid-body-platform-constants
|
|
|
|
:info (new 'static 'rigid-body-info
|
|
|
|
:mass 1.48
|
|
|
|
:inv-mass 0.6756757
|
|
|
|
:linear-damping 0.8
|
|
|
|
:angular-damping 0.5
|
|
|
|
:friction-factor 0.1
|
|
|
|
:cm-offset-joint (new 'static 'vector :w 1.0)
|
|
|
|
:inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 1) (meters 5))
|
|
|
|
)
|
|
|
|
:extra (new 'static 'rigid-body-object-extra-info
|
|
|
|
:max-time-step 0.02
|
|
|
|
:gravity (meters 80)
|
|
|
|
:idle-distance (meters 50)
|
|
|
|
:attack-force-scale 1.0
|
|
|
|
)
|
|
|
|
:name '*under-buoy-plat-platform-constants*
|
|
|
|
:drag-factor 2.0
|
|
|
|
:buoyancy-factor 2.3
|
|
|
|
:max-buoyancy-depth (meters 1.5)
|
|
|
|
:player-weight (meters 150)
|
|
|
|
:player-bonk-factor 0.5
|
|
|
|
:player-dive-factor 1.0
|
|
|
|
:player-force-distance (meters 2)
|
|
|
|
:player-force-clamp (meters 1000000)
|
|
|
|
:player-force-timeout #x1e
|
|
|
|
:explosion-force (meters 1000)
|
|
|
|
:control-point-count 5
|
|
|
|
:platform #t
|
|
|
|
:sound-name "ruins-plat"
|
|
|
|
)
|
|
|
|
)
|
2023-01-28 16:02:58 -05:00
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod rigid-body-platform-method-53 ((this under-buoy-plat) (arg0 vector))
|
2023-01-28 16:02:58 -05:00
|
|
|
-220341.05
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod rigid-body-platform-method-56 ((this under-buoy-plat) (arg0 vector))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-! v1-0 arg0 (-> this rbody state position))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> v1-0 y) 0.0)
|
|
|
|
(let* ((f0-1 (vector-length v1-0))
|
|
|
|
(f1-1 (* 4.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1)))))
|
|
|
|
)
|
|
|
|
(when (< 0.0 f1-1)
|
|
|
|
(vector-float*! v1-0 v1-0 (/ f1-1 f0-1))
|
2023-09-26 10:17:00 -04:00
|
|
|
(rigid-body-method-20 (-> this rbody state) v1-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-skel-and-rigid-body ((this under-buoy-plat))
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-plat" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(alloc-and-init-rigid-body-control this *under-buoy-plat-platform-constants*)
|
|
|
|
(set! (-> this orig-trans quad) (-> this root trans quad))
|
|
|
|
(set! (-> this anchor-point quad) (-> this root trans quad))
|
|
|
|
(set! (-> this surface-height) (-> this root trans y))
|
|
|
|
(set! (-> this info info cm-offset-joint y) 6144.0)
|
|
|
|
(let ((s5-1 (-> this info control-point-count)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(dotimes (s4-1 s5-1)
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s3-0 (-> this control-point-array data s4-1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1)))))
|
|
|
|
(set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0)))
|
|
|
|
(set! (-> s3-0 local-pos y) 8192.0)
|
|
|
|
(set! (-> s3-0 local-pos z) (* 12288.0 (cos f30-0)))
|
|
|
|
)
|
|
|
|
(set! (-> s3-0 local-pos w) 1.0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(process-spawn under-buoy-chain (target-pos 0) (-> this entity) :to this)
|
|
|
|
(set! (-> this base) (process-spawn under-buoy-base (target-pos 0) (-> this entity) :to this))
|
|
|
|
(logior! (-> this mask) (process-mask actor-pause))
|
|
|
|
(set! (-> this draw light-index) (the-as uint 2))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod rigid-body-object-method-34 ((this under-buoy-plat))
|
2023-09-26 10:17:00 -04:00
|
|
|
(if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
|
|
|
|
(go (method-of-object this running))
|
|
|
|
(go (method-of-object this waiting))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate waiting (under-buoy-plat)
|
|
|
|
:virtual #t
|
2023-09-22 05:54:49 -04:00
|
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
|
|
(case message
|
2023-01-28 16:02:58 -05:00
|
|
|
(('attack)
|
2023-09-22 05:54:49 -04:00
|
|
|
(case (-> (the-as attack-info (-> block param 1)) mode)
|
2023-01-28 16:02:58 -05:00
|
|
|
(('mech-punch 'crush)
|
|
|
|
(go-virtual running)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(('base-hit)
|
|
|
|
(go-virtual running)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate running (under-buoy-plat)
|
|
|
|
:virtual #t
|
2023-09-23 09:53:50 -04:00
|
|
|
:event rigid-body-object-event-handler
|
2023-01-28 16:02:58 -05:00
|
|
|
:enter (behavior ()
|
|
|
|
(sound-play "break-chain")
|
|
|
|
(send-event (ppointer->process (-> self base)) 'release)
|
|
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(until #f
|
2023-09-23 09:53:50 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
|
|
|
(ja :num! (seek!))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
|
|
|
:post (behavior ()
|
|
|
|
(rigid-body-object-method-37 self)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defskelgroup skel-under-mine under-mine under-mine-lod0-jg under-mine-idle-ja
|
|
|
|
((under-mine-lod0-mg (meters 20)) (under-mine-lod1-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 0 9)
|
|
|
|
:shadow under-mine-shadow-mg
|
|
|
|
:origin-joint-index 12
|
|
|
|
)
|
|
|
|
|
|
|
|
(defskelgroup skel-under-mine-explode under-mine under-mine-explode-lod0-jg under-mine-explode-idle-ja
|
|
|
|
((under-mine-explode-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 0 9)
|
|
|
|
:origin-joint-index 11
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-mine-chain-physics (chain-physics)
|
|
|
|
()
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod apply-gravity ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable))
|
2023-01-28 16:02:58 -05:00
|
|
|
(local-vars (v1-7 vector) (v1-11 vector) (a0-17 float) (a0-26 float))
|
|
|
|
(rlet ((acc :class vf)
|
|
|
|
(vf0 :class vf)
|
|
|
|
(vf1 :class vf)
|
|
|
|
(vf2 :class vf)
|
|
|
|
)
|
|
|
|
(init-vf0-vector)
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-float*! arg0 (-> this gravity) (* 81.92 (-> self clock time-adjust-ratio)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(cond
|
2023-09-26 10:17:00 -04:00
|
|
|
((= arg1 (+ (-> this num-joints) -1))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((v1-4 (new 'stack-no-clear 'vector)))
|
|
|
|
(set! (-> v1-4 quad) (-> arg2 entity trans quad))
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-! v1-4 v1-4 (the-as vector (-> this chain-joints arg1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(vector+float*! arg0 arg0 v1-4 1.0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(cond
|
2023-09-26 10:17:00 -04:00
|
|
|
((>= arg1 (the-as int (+ (-> this num-joints) -1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! v1-7 (new 'stack-no-clear 'vector))
|
|
|
|
(set! (-> v1-7 quad) (-> arg2 entity trans quad))
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> v1-7 y) 8192.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(else
|
|
|
|
(set! v1-7 (new 'stack-no-clear 'vector))
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> v1-7 quad) (-> this chain-joints (+ arg1 1) position quad))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-! v1-7 v1-7 (the-as vector (-> this chain-joints arg1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(.lvf vf1 (&-> v1-7 quad))
|
|
|
|
(.add.w.vf vf2 vf0 vf0 :mask #b1)
|
|
|
|
(.mul.vf vf1 vf1 vf1)
|
|
|
|
(.mul.x.vf acc vf2 vf1 :mask #b1)
|
|
|
|
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
|
|
|
|
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
|
|
|
|
(.mov a0-17 vf1)
|
|
|
|
(let ((f0-6 (sqrtf a0-17)))
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector+float*! arg0 arg0 v1-7 (/ (* 1.1 (- f0-6 (-> this joint-length))) f0-6))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(set! v1-11
|
|
|
|
(cond
|
|
|
|
((zero? arg1)
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector<-cspace! (new 'stack-no-clear 'vector) (-> arg2 node-list data (-> this root-joint-index)))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(else
|
|
|
|
(set! v1-11 (new 'stack-no-clear 'vector))
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> v1-11 quad) (-> this chain-joints (+ arg1 -1) position quad))
|
2023-01-28 16:02:58 -05:00
|
|
|
v1-11
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-! v1-11 v1-11 (the-as vector (-> this chain-joints arg1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(.lvf vf1 (&-> v1-11 quad))
|
|
|
|
(.add.w.vf vf2 vf0 vf0 :mask #b1)
|
|
|
|
(.mul.vf vf1 vf1 vf1)
|
|
|
|
(.mul.x.vf acc vf2 vf1 :mask #b1)
|
|
|
|
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
|
|
|
|
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
|
|
|
|
(.mov a0-26 vf1)
|
|
|
|
(let ((f0-9 (sqrtf a0-26)))
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector+float*! arg0 arg0 v1-11 (/ (* 1.1 (- f0-9 (-> this joint-length))) f0-9))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod chain-physics-method-14 ((this under-mine-chain-physics) (arg0 vector) (arg1 int))
|
2023-01-28 16:02:58 -05:00
|
|
|
(vector-reset! arg0)
|
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch int vs vector.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod clamp-length ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
|
|
|
(set! (-> v1-0 quad) (-> arg3 entity trans quad))
|
|
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> v1-0 y) -19660.8)
|
2023-01-28 16:02:58 -05:00
|
|
|
(vector-! s5-0 arg0 v1-0)
|
|
|
|
(let ((f0-2 (vector-normalize-ret-len! s5-0 1.0)))
|
|
|
|
(if (< f0-2 20480.0)
|
|
|
|
(vector+float*! arg0 arg0 s5-0 (- 20480.0 f0-2))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(the-as vector 0)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod chain-physics-method-16 ((this under-mine-chain-physics) (arg0 int))
|
2023-01-28 16:02:58 -05:00
|
|
|
21845.334
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-mine (process-drawable)
|
2023-10-29 23:20:02 -04:00
|
|
|
((root collide-shape-moving :override)
|
|
|
|
(chain under-mine-chain-physics)
|
|
|
|
(chain-initialized symbol)
|
|
|
|
(main-mod joint-mod)
|
|
|
|
(head-mod joint-mod)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
explode
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(define *under-mine-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 14)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 13)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 12)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 11)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 10)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 9)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 8)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 7)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 6)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 5)
|
|
|
|
(new 'static 'chain-physics-setup :joint-index 4)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(define *under-mine-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 3 :parent-joint-index 4)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 5)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 6)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 7)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 8)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 9)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 10)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 11)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 12)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 13)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 14)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 15)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 15)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 15)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 15)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 15)
|
|
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 15)
|
|
|
|
)
|
|
|
|
:collide-spec #x1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate explode (under-mine)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
2023-09-26 10:17:00 -04:00
|
|
|
(set-time! (-> self state-time))
|
2023-07-04 17:23:24 -04:00
|
|
|
(let ((v1-3 (-> self root root-prim)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> v1-3 prim-core collide-as) (collide-spec))
|
|
|
|
(set! (-> v1-3 prim-core collide-with) (collide-spec))
|
|
|
|
)
|
|
|
|
0
|
|
|
|
(let ((gp-0 (new 'stack-no-clear 'explosion-init-params)))
|
|
|
|
(let ((v1-9
|
|
|
|
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self chain root-joint-index)))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(vector+float*!
|
|
|
|
v1-9
|
|
|
|
v1-9
|
|
|
|
(-> self node-list data (-> self chain root-joint-index) bone transform vector 1)
|
|
|
|
10240.0
|
|
|
|
)
|
|
|
|
(set! (-> gp-0 spawn-point quad) (-> v1-9 quad))
|
|
|
|
)
|
2023-07-04 17:23:24 -04:00
|
|
|
(quaternion-copy! (-> gp-0 spawn-quat) (-> self root quat))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> gp-0 radius) 16384.0)
|
|
|
|
(set! (-> gp-0 group) (-> *part-group-id-table* 501))
|
|
|
|
(set! (-> gp-0 collide-with)
|
|
|
|
(collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher)
|
|
|
|
)
|
|
|
|
(set! (-> gp-0 penetrate-using) (penetrate explode))
|
|
|
|
(explosion-spawn (the-as process-drawable *default-pool*) explosion gp-0)
|
|
|
|
)
|
|
|
|
(let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0))))
|
|
|
|
(set! (-> gp-1 duration) (seconds 4))
|
|
|
|
(set! (-> gp-1 gravity) -20480.0)
|
|
|
|
(set! (-> gp-1 rot-speed) 4.2)
|
|
|
|
(set-vector! (-> gp-1 fountain-rand-transv-lo) -40960.0 20480.0 -40960.0 1.0)
|
|
|
|
(set-vector! (-> gp-1 fountain-rand-transv-hi) 40960.0 49152.0 40960.0 1.0)
|
|
|
|
(process-spawn
|
|
|
|
joint-exploder
|
|
|
|
(art-group-get-by-name *level* "skel-under-mine-explode" (the-as (pointer uint32) #f))
|
|
|
|
7
|
|
|
|
gp-1
|
|
|
|
*under-mine-exploder-params*
|
|
|
|
:to self
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(sound-play "buoy-explode")
|
|
|
|
(activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock))
|
|
|
|
(ja-channel-set! 0)
|
|
|
|
(ja-post)
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(when (not (-> self child))
|
|
|
|
(cleanup-for-death self)
|
|
|
|
(deactivate self)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-mine)
|
|
|
|
:virtual #t
|
2023-09-22 05:54:49 -04:00
|
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
|
|
(case message
|
2023-01-28 16:02:58 -05:00
|
|
|
(('attack 'bonk 'touched)
|
|
|
|
(go-virtual explode)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:trans (behavior ()
|
|
|
|
(local-vars (a0-8 float))
|
|
|
|
(rlet ((acc :class vf)
|
|
|
|
(vf0 :class vf)
|
|
|
|
(vf1 :class vf)
|
|
|
|
(vf2 :class vf)
|
|
|
|
)
|
|
|
|
(init-vf0-vector)
|
|
|
|
(ja :num! (loop!))
|
|
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
|
|
(set! (-> gp-0 quad) (-> self entity trans quad))
|
|
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
|
|
(cond
|
|
|
|
(*target*
|
|
|
|
(set! (-> s5-0 quad) (-> (get-trans *target* 3) quad))
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> s5-0 y) -28672.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(else
|
|
|
|
(set! (-> s5-0 quad) (-> gp-0 quad))
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> s5-0 y) -1024.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
2023-07-08 02:34:38 -04:00
|
|
|
(+! (-> gp-0 y) -28672.0)
|
2023-07-04 17:23:24 -04:00
|
|
|
(vector-seek-3d-smooth! (-> self root trans) s5-0 (* 204.8 (-> self clock time-adjust-ratio)) 0.25)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-07-04 17:23:24 -04:00
|
|
|
(let ((v1-21 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) gp-0)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(.lvf vf1 (&-> v1-21 quad))
|
|
|
|
(.add.w.vf vf2 vf0 vf0 :mask #b1)
|
|
|
|
(.mul.vf vf1 vf1 vf1)
|
|
|
|
(.mul.x.vf acc vf2 vf1 :mask #b1)
|
|
|
|
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
|
|
|
|
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
|
|
|
|
(.mov a0-8 vf1)
|
|
|
|
(let ((f0-9 a0-8)
|
|
|
|
(f1-4 28672.0)
|
|
|
|
)
|
|
|
|
(if (< (* f1-4 f1-4) f0-9)
|
|
|
|
(vector-float*! v1-21 v1-21 (/ 28672.0 (sqrtf f0-9)))
|
|
|
|
)
|
|
|
|
)
|
2023-07-04 17:23:24 -04:00
|
|
|
(vector+! (-> self root trans) gp-0 v1-21)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-07-04 17:23:24 -04:00
|
|
|
(set! (-> self root trans y) (fmax (-> self root trans y) (+ 409.6 (-> gp-0 y))))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(when (-> self chain-initialized)
|
|
|
|
(let ((s5-1 (new-stack-vector0))
|
|
|
|
(gp-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self head-mod quat)))
|
|
|
|
)
|
|
|
|
(dotimes (v1-27 (min 8 (the-as int (-> self chain num-joints))))
|
|
|
|
(vector+! s5-1 s5-1 (the-as vector (-> self chain chain-joints v1-27)))
|
|
|
|
)
|
|
|
|
(vector-float*! s5-1 s5-1 (/ 1.0 (the float (min 8 (the-as int (-> self chain num-joints))))))
|
|
|
|
(vector-!
|
|
|
|
s5-1
|
|
|
|
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self chain root-joint-index)))
|
|
|
|
s5-1
|
|
|
|
)
|
|
|
|
(vector-normalize! s5-1 1.0)
|
|
|
|
(vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (* 0.5 (-> self clock time-adjust-ratio)) 0.5)
|
|
|
|
(vector-normalize! s5-1 1.0)
|
|
|
|
(quaternion-from-two-vectors-partial!
|
|
|
|
(-> self head-mod quat)
|
|
|
|
(new 'static 'vector :y 1.0)
|
|
|
|
(-> gp-1 vector 1)
|
|
|
|
0.25
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(update (-> self chain) self)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:code sleep-code
|
2023-01-28 16:02:58 -05:00
|
|
|
:post (behavior ()
|
|
|
|
(transform-post)
|
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
|
|
|
(if *nav-network*
|
2023-07-04 17:23:24 -04:00
|
|
|
(nav-network-method-25 *nav-network* self (-> self root root-prim prim-core))
|
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
|
|
|
)
|
2023-01-28 16:02:58 -05:00
|
|
|
(when (not (-> self chain-initialized))
|
|
|
|
(set! (-> self chain-initialized) #t)
|
|
|
|
(initialize-chain-joints (-> self chain))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch process-drawable vs under-mine.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod relocate ((this under-mine) (arg0 int))
|
2023-09-26 10:17:00 -04:00
|
|
|
(if (nonzero? (-> this main-mod))
|
|
|
|
(&+! (-> this main-mod) arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(if (nonzero? (-> this head-mod))
|
|
|
|
(&+! (-> this head-mod) arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(if (nonzero? (-> this chain))
|
|
|
|
(&+! (-> this chain) arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(the-as under-mine ((method-of-type process-drawable relocate) this arg0))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-mine) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
|
|
|
|
(set! (-> v1-2 prim-core collide-as) (collide-spec enemy camera-blocker))
|
|
|
|
(set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
|
|
(set! (-> v1-2 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-2 transform-index) 15)
|
|
|
|
(set-vector! (-> v1-2 local-sphere) 0.0 12288.0 0.0 10240.0)
|
|
|
|
(set! (-> s4-0 total-prims) (the-as uint 1))
|
|
|
|
(set! (-> s4-0 root-prim) v1-2)
|
|
|
|
)
|
|
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-5 (-> s4-0 root-prim)))
|
|
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as))
|
|
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with))
|
|
|
|
)
|
|
|
|
(set! (-> s4-0 event-self) 'touched)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) (the-as collide-shape-moving s4-0))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(process-drawable-from-entity! this arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-mine" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this chain-initialized) #f)
|
|
|
|
(set! (-> this chain) (new 'process 'under-mine-chain-physics))
|
|
|
|
(chain-physics-initialize this (-> this chain) 15 1843.2 *under-mine-chain-setup*)
|
|
|
|
(set! (-> this chain negate-y) #t)
|
|
|
|
(set! (-> this chain axial-slop) 1820.4445)
|
|
|
|
(set! (-> this chain maximum-stretch) 100.0)
|
|
|
|
(set! (-> this chain stretch-vel) 0.7)
|
|
|
|
(set! (-> this chain stretch-vel-parallel) 0.9)
|
|
|
|
(set! (-> this chain compress-vel) 0.85)
|
|
|
|
(set! (-> this chain compress-vel-parallel) 0.9)
|
|
|
|
(set! (-> this main-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 3))
|
|
|
|
(set! (-> this main-mod track-mode) (track-mode no-rotate no-scale))
|
|
|
|
(mode-set! (-> this main-mod) (joint-mod-mode joint-set-world))
|
|
|
|
(set! (-> this main-mod trans quad) (-> this entity trans quad))
|
|
|
|
(set! (-> this head-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 15))
|
|
|
|
(set! (-> this head-mod track-mode) (track-mode no-trans no-scale))
|
|
|
|
(mode-set! (-> this head-mod) (joint-mod-mode joint-set*))
|
|
|
|
(quaternion-identity! (-> this head-mod quat))
|
|
|
|
(set! (-> this draw light-index) (the-as uint 10))
|
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-lift (elevator)
|
2023-10-29 23:20:02 -04:00
|
|
|
((sound-id sound-id)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(:methods
|
2023-10-29 23:20:02 -04:00
|
|
|
(under-lift-method-49 (_type_ symbol) none)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-lift under-lift under-lift-lod0-jg under-lift-idle-ja
|
|
|
|
((under-lift-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 5.6 9.2)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod get-art-group ((this under-lift))
|
2023-01-28 16:02:58 -05:00
|
|
|
"@returns The associated [[art-group]]"
|
|
|
|
(art-group-get-by-name *level* "skel-under-lift" (the-as (pointer uint32) #f))
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod move-between-points ((this under-lift) (arg0 vector) (arg1 float) (arg2 float))
|
2023-01-28 16:02:58 -05:00
|
|
|
"Move between two points on the elevator's path
|
|
|
|
@param vec TODO not sure
|
|
|
|
@param point-a The first point fetched from the elevator's path
|
|
|
|
@param point-b The second point fetched from the path
|
|
|
|
@see [[path-control]] and [[elevator]]"
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp))
|
|
|
|
(a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp))
|
|
|
|
(v1-3 (-> this root trans))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y))))
|
|
|
|
(let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3)))
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat))
|
2023-01-28 16:02:58 -05:00
|
|
|
(and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod commited-to-ride? ((this under-lift))
|
2023-01-28 16:02:58 -05:00
|
|
|
"@returns if the target is considered within the elevator area enough to begin descending/ascending"
|
|
|
|
(let* ((gp-0 *target*)
|
|
|
|
(a0-2 (if (type? gp-0 process-focusable)
|
|
|
|
gp-0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(when a0-2
|
|
|
|
(let* ((v1-1 (get-trans a0-2 0))
|
2023-09-26 10:17:00 -04:00
|
|
|
(gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans)))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat))
|
2023-01-28 16:02:58 -05:00
|
|
|
(and (< (fabs (-> gp-2 x)) 20480.0) (< 0.0 (-> gp-2 z)) (< (-> gp-2 z) 40960.0))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod under-lift-method-49 ((this under-lift) (arg0 symbol))
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(cond
|
|
|
|
(arg0
|
|
|
|
(set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher))
|
|
|
|
(set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list))
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(set! (-> v1-3 prim-core collide-as) (collide-spec))
|
|
|
|
(set! (-> v1-3 prim-core collide-with) (collide-spec))
|
|
|
|
0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate running (under-lift)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
(let ((t9-0 (-> (method-of-type elevator running) enter)))
|
|
|
|
(if t9-0
|
|
|
|
(t9-0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(when (and (logtest? (-> self elevator-status) (elevator-status waiting-to-descend))
|
|
|
|
(logtest? (elevator-flags airlock-opened) (-> self params flags))
|
|
|
|
)
|
|
|
|
(under-lift-method-49 self #t)
|
2023-05-16 18:08:35 -04:00
|
|
|
(set-setting! 'jump #f 0.0 0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
:post (behavior ()
|
|
|
|
(let ((t9-0 (-> (method-of-type elevator running) post)))
|
|
|
|
(if t9-0
|
|
|
|
((the-as (function none) t9-0))
|
|
|
|
)
|
|
|
|
)
|
2023-07-04 17:23:24 -04:00
|
|
|
(sound-play "under-lift-lp" :id (-> self sound-id) :position (-> self root trans))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate arrived (under-lift)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
(let ((t9-0 (-> (method-of-type elevator arrived) enter)))
|
|
|
|
(if t9-0
|
|
|
|
(t9-0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(sound-stop (-> self sound-id))
|
|
|
|
(sound-play "sew-elev-stop")
|
|
|
|
(when (and (logtest? (-> self elevator-status) (elevator-status waiting-to-descend))
|
|
|
|
(logtest? (elevator-flags airlock-opened) (-> self params flags))
|
|
|
|
)
|
|
|
|
(under-lift-method-49 self #f)
|
|
|
|
(remove-setting! 'jump)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod deactivate ((this under-lift))
|
2023-09-26 10:17:00 -04:00
|
|
|
(sound-stop (-> this sound-id))
|
2023-09-30 11:06:09 -04:00
|
|
|
(call-parent-method this)
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-plat! ((this under-lift))
|
2023-01-28 16:02:58 -05:00
|
|
|
"Does any necessary initial platform setup.
|
|
|
|
For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound."
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this sound-id) (new-sound-id))
|
|
|
|
(set! (-> this draw light-index) (the-as uint 4))
|
2023-01-28 16:02:58 -05:00
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-plat-collision! ((this under-lift))
|
2023-01-28 16:02:58 -05:00
|
|
|
"TODO - collision stuff for setting up the platform"
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(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)
|
|
|
|
)
|
|
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
|
|
|
|
(set! (-> s5-0 total-prims) (the-as uint 3))
|
|
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
|
|
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
|
|
|
|
(set! (-> s4-0 transform-index) 3)
|
|
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 22937.6 37683.2)
|
|
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
|
|
)
|
|
|
|
(pusher-init s5-0)
|
|
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
|
|
|
|
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> v1-15 prim-core action) (collide-action solid rideable))
|
|
|
|
(set! (-> v1-15 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 22937.6 37683.2)
|
|
|
|
)
|
|
|
|
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
|
|
|
|
(set! (-> v1-17 prim-core action) (collide-action solid))
|
|
|
|
(set! (-> v1-17 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 22937.6 39321.6)
|
|
|
|
)
|
|
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-20 (-> s5-0 root-prim)))
|
|
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as))
|
|
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) s5-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(under-lift-method-49 this #f)
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-break-door (process-focusable)
|
2023-10-29 23:20:02 -04:00
|
|
|
((anim art-joint-anim)
|
|
|
|
(art-name string)
|
|
|
|
(collide-mesh int32)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
(hit symbol)
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-break-door under-break-door under-break-door-lod0-jg -1
|
|
|
|
((under-break-door-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 0 0 14)
|
|
|
|
:origin-joint-index 3
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-break-door)
|
|
|
|
:virtual #t
|
2023-09-22 05:54:49 -04:00
|
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
|
|
(case message
|
2023-01-28 16:02:58 -05:00
|
|
|
(('trigger)
|
|
|
|
(go-virtual hit #f)
|
|
|
|
)
|
|
|
|
(('attack)
|
2023-09-22 05:54:49 -04:00
|
|
|
(case (-> (the-as attack-info (-> block param 1)) mode)
|
2023-01-28 16:02:58 -05:00
|
|
|
(('mech-punch 'crush)
|
|
|
|
(go-virtual hit #f)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(('combo)
|
|
|
|
#t
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(add-process
|
|
|
|
*gui-control*
|
|
|
|
self
|
|
|
|
(gui-channel art-load)
|
|
|
|
(gui-action queue)
|
|
|
|
(the-as string (-> self anim extra))
|
|
|
|
-99.0
|
|
|
|
0
|
|
|
|
)
|
|
|
|
(until #f
|
|
|
|
(transform-post)
|
|
|
|
(logior! (-> self mask) (process-mask sleep))
|
|
|
|
(suspend)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate hit (under-break-door)
|
|
|
|
:virtual #t
|
|
|
|
:exit (behavior ()
|
|
|
|
(ja-abort-spooled-anim (the-as spool-anim (-> self anim)) (the-as art-joint-anim #f) -1)
|
|
|
|
)
|
|
|
|
:code (behavior ((arg0 symbol))
|
|
|
|
(set! (-> self draw force-lod) 0)
|
|
|
|
(-> self draw bounds w)
|
2023-07-04 17:23:24 -04:00
|
|
|
(let ((v1-3 (-> self root root-prim)))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> v1-3 prim-core collide-as) (collide-spec))
|
|
|
|
(set! (-> v1-3 prim-core collide-with) (collide-spec))
|
|
|
|
)
|
|
|
|
0
|
|
|
|
(set! (-> self draw bounds w) 573440.0)
|
|
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
|
|
(let* ((s5-0 (-> self draw art-group))
|
|
|
|
(s4-0 (method-of-object s5-0 get-art-by-name-method))
|
|
|
|
)
|
|
|
|
(format (clear *temp-string*) "~S-end" (-> self art-name))
|
|
|
|
(let ((s5-1 (s4-0 s5-0 *temp-string* art-joint-anim)))
|
|
|
|
(if (not arg0)
|
|
|
|
(ja-play-spooled-anim
|
|
|
|
(the-as spool-anim (-> self anim))
|
|
|
|
(ja-group)
|
2023-09-26 10:17:00 -04:00
|
|
|
;; og:preserve-this added cast
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as art-joint-anim s5-1)
|
|
|
|
(the-as (function process-drawable symbol) false-func)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(ja-channel-set! 1)
|
2023-09-26 10:17:00 -04:00
|
|
|
;; og:preserve-this added cast
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-1))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(suspend)
|
|
|
|
(logior! (-> self mask) (process-mask sleep))
|
|
|
|
(suspend)
|
|
|
|
0
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-break-door) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(stack-size-set! (-> this main-thread) 512)
|
|
|
|
(logior! (-> this mask) (process-mask collectable))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((s3-0 ((method-of-type res-lump get-property-struct)
|
2023-09-26 10:17:00 -04:00
|
|
|
(-> this entity)
|
2023-01-28 16:02:58 -05:00
|
|
|
'art-name
|
|
|
|
'interp
|
|
|
|
-1000000000.0
|
|
|
|
"under-break-door-1"
|
|
|
|
(the-as (pointer res-tag) #f)
|
|
|
|
*res-static-buf*
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(s4-0 (art-group-get-by-name *level* "skel-under-break-door" (the-as (pointer uint32) #f)))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this art-name) (the-as string s3-0))
|
|
|
|
(let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s2-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) 3)
|
|
|
|
(set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 57344.0)
|
|
|
|
(set! (-> s2-0 total-prims) (the-as uint 1))
|
|
|
|
(set! (-> s2-0 root-prim) v1-8)
|
|
|
|
)
|
|
|
|
(set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-11 (-> s2-0 root-prim)))
|
|
|
|
(set! (-> s2-0 backup-collide-as) (-> v1-11 prim-core collide-as))
|
|
|
|
(set! (-> s2-0 backup-collide-with) (-> v1-11 prim-core collide-with))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) s2-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(cond
|
2023-09-26 10:17:00 -04:00
|
|
|
((string= (-> this art-name) "under-break-door-1")
|
|
|
|
(set! (-> this anim)
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as
|
|
|
|
art-joint-anim
|
|
|
|
(new 'static 'spool-anim :name "under-break-door-1" :anim-name "1-break" :parts 1 :command-list '())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
((string= (-> this art-name) "under-break-door-2")
|
|
|
|
(set! (-> this anim)
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as
|
|
|
|
art-joint-anim
|
|
|
|
(new 'static 'spool-anim :name "under-break-door-2" :anim-name "2-break" :parts 1 :command-list '())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
((string= (-> this art-name) "under-break-door-3")
|
|
|
|
(set! (-> this anim)
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as
|
|
|
|
art-joint-anim
|
|
|
|
(new 'static 'spool-anim :name "under-break-door-3" :anim-name "3-break" :parts 2 :command-list '())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
((string= (-> this art-name) "under-break-door-4")
|
|
|
|
(set! (-> this anim)
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as
|
|
|
|
art-joint-anim
|
|
|
|
(new 'static 'spool-anim :name "under-break-door-4" :anim-name "4-break" :parts 1 :command-list '())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(else
|
|
|
|
(go process-drawable-art-error (the-as string s3-0))
|
|
|
|
)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(process-drawable-from-entity! this arg0)
|
|
|
|
(initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(ja-channel-set! 1)
|
2023-09-26 10:17:00 -04:00
|
|
|
(let* ((s5-1 (-> this skel root-channel 0))
|
|
|
|
(s4-1 (-> this draw art-group))
|
2023-01-28 16:02:58 -05:00
|
|
|
(s3-1 (method-of-object s4-1 get-art-by-name-method))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(format (clear *temp-string*) "~S-idle" (-> this art-name))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f))))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this draw light-index) (the-as uint 10))
|
|
|
|
(if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
|
|
|
|
(go (method-of-object this hit) #t)
|
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-seaweed-a (process-drawable)
|
|
|
|
()
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-seaweed-a under-seaweed-a under-seaweed-a-lod0-jg under-seaweed-a-idle-ja
|
|
|
|
((under-seaweed-a-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 2 0 3)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-seaweed-a)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(until #f
|
2023-09-23 09:53:50 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
|
|
|
(ja :num! (seek!))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-seaweed-a) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
|
|
|
|
(set! (-> s4-0 reaction) cshape-reaction-default)
|
|
|
|
(set! (-> s4-0 no-reaction)
|
|
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
|
|
)
|
|
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0)))
|
|
|
|
(set! (-> s4-0 total-prims) (the-as uint 5))
|
|
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
|
|
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
|
|
|
|
(set! (-> s3-0 transform-index) 3)
|
|
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 22937.6 37683.2)
|
|
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
|
|
)
|
|
|
|
(pusher-init s4-0)
|
|
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
|
|
(set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker))
|
|
|
|
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> v1-15 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 8192.0 0.0 12288.0)
|
|
|
|
)
|
|
|
|
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
|
|
|
|
(set! (-> v1-17 prim-core collide-as) (collide-spec obstacle camera-blocker))
|
|
|
|
(set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> v1-17 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-17 local-sphere) 0.0 8192.0 0.0 12288.0)
|
|
|
|
)
|
|
|
|
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
|
|
|
|
(set! (-> v1-19 prim-core collide-as) (collide-spec obstacle camera-blocker))
|
|
|
|
(set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> v1-19 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-19 local-sphere) 0.0 8192.0 0.0 12288.0)
|
|
|
|
)
|
|
|
|
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0))))
|
|
|
|
(set! (-> v1-21 prim-core collide-as) (collide-spec obstacle camera-blocker))
|
|
|
|
(set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list))
|
|
|
|
(set! (-> v1-21 transform-index) 3)
|
|
|
|
(set-vector! (-> v1-21 local-sphere) 0.0 8192.0 0.0 12288.0)
|
|
|
|
)
|
|
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
|
|
(let ((v1-24 (-> s4-0 root-prim)))
|
|
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as))
|
|
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with))
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) s4-0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(process-drawable-from-entity! this arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-a" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-seaweed-b (process-drawable)
|
|
|
|
()
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-seaweed-b under-seaweed-b under-seaweed-b-lod0-jg under-seaweed-b-idle-ja
|
|
|
|
((under-seaweed-b-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 4 0 5)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-seaweed-b)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(until #f
|
2023-09-23 09:53:50 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
|
|
|
(ja :num! (seek!))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-seaweed-b) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) (new 'process 'trsqv))
|
|
|
|
(process-drawable-from-entity! this arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-b" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-seaweed-c (process-drawable)
|
|
|
|
()
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-seaweed-c under-seaweed-c under-seaweed-c-lod0-jg under-seaweed-c-idle-ja
|
|
|
|
((under-seaweed-c-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 3 0 4)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-seaweed-c)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(until #f
|
2023-09-23 09:53:50 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
|
|
|
(ja :num! (seek!))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-seaweed-c) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) (new 'process 'trsqv))
|
|
|
|
(process-drawable-from-entity! this arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-c" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
|
|
|
(deftype under-seaweed-d (process-drawable)
|
|
|
|
()
|
2023-10-29 23:20:02 -04:00
|
|
|
(:state-methods
|
|
|
|
idle
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defskelgroup skel-under-seaweed-d under-seaweed-d under-seaweed-d-lod0-jg under-seaweed-d-idle-ja
|
|
|
|
((under-seaweed-d-lod0-mg (meters 999999)))
|
|
|
|
:bounds (static-spherem 0 6 0 7)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defstate idle (under-seaweed-d)
|
|
|
|
:virtual #t
|
|
|
|
:enter (behavior ()
|
|
|
|
0
|
|
|
|
)
|
|
|
|
:code (behavior ()
|
|
|
|
(until #f
|
2023-09-23 09:53:50 -04:00
|
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(until (ja-done? 0)
|
|
|
|
(suspend)
|
|
|
|
(ja :num! (seek!))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#f
|
|
|
|
)
|
2023-09-23 09:53:50 -04:00
|
|
|
:post ja-post
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-from-entity! ((this under-seaweed-d) (arg0 entity-actor))
|
2023-01-28 16:02:58 -05:00
|
|
|
"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"
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this root) (new 'process 'trsqv))
|
|
|
|
(process-drawable-from-entity! this arg0)
|
2023-01-28 16:02:58 -05:00
|
|
|
(initialize-skeleton
|
2023-09-26 10:17:00 -04:00
|
|
|
this
|
2023-01-28 16:02:58 -05:00
|
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-d" (the-as (pointer uint32) #f)))
|
|
|
|
(the-as pair 0)
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(go (method-of-object this idle))
|
2023-01-28 16:02:58 -05:00
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod draw ((this hud-mech-air-tank))
|
2023-01-28 16:02:58 -05:00
|
|
|
(set-hud-piece-position!
|
2023-09-26 10:17:00 -04:00
|
|
|
(the-as hud-sprite (-> this sprites))
|
|
|
|
(the int (+ 472.0 (* 100.0 (-> this offset))))
|
2023-01-28 16:02:58 -05:00
|
|
|
208
|
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 51)
|
|
|
|
(set! (-> this sprites 0 scale-x) 0.8)
|
|
|
|
(set! (-> this sprites 0 scale-y) 0.8)
|
|
|
|
(set! (-> this sprites 1 scale-x) 0.8)
|
|
|
|
(set! (-> this sprites 1 scale-y) 0.8)
|
|
|
|
(set! (-> this sprites 3 scale-x) 0.8)
|
|
|
|
(set! (-> this sprites 3 scale-y) 0.8)
|
|
|
|
(set! (-> this sprites 2 scale-x) 3.2)
|
|
|
|
(set! (-> this sprites 2 scale-y) (* 4.56 (- 1.0 (-> *game-info* air-supply))))
|
|
|
|
(set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 2)
|
|
|
|
(set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -30 -20)
|
|
|
|
((method-of-type hud draw) this)
|
2023-01-28 16:02:58 -05:00
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod update-values ((this hud-mech-air-tank))
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this values 0 target) (the int (-> *game-info* air-supply)))
|
|
|
|
(logclear! (-> this flags) (hud-flags disable))
|
|
|
|
((method-of-type hud update-values) this)
|
2023-01-28 16:02:58 -05:00
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|
|
|
|
|
2023-10-29 23:20:02 -04:00
|
|
|
(defmethod init-callback ((this hud-mech-air-tank))
|
2023-09-26 10:17:00 -04:00
|
|
|
(set! (-> this gui-id)
|
|
|
|
(add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0)
|
2023-01-28 16:02:58 -05:00
|
|
|
)
|
2023-09-26 10:17:00 -04:00
|
|
|
(logior! (-> this flags) (hud-flags show))
|
|
|
|
(set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd55)))
|
|
|
|
(set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xd55)))
|
|
|
|
(set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xd55)))
|
|
|
|
(set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd55)))
|
2023-01-28 16:02:58 -05:00
|
|
|
0
|
|
|
|
(none)
|
|
|
|
)
|