From 32ec1c0100eaee5ed07a359638cbcb932006a29d Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 18 May 2024 21:50:46 -0400 Subject: [PATCH] format/j1: made it through about 10% of files --- goal_src/jak1/engine/collide/collide-cache.gc | 1495 ++----- .../engine/collide/collide-edge-grab-h.gc | 234 +- .../jak1/engine/collide/collide-edge-grab.gc | 617 +-- .../jak1/engine/collide/collide-frag-h.gc | 43 +- goal_src/jak1/engine/collide/collide-frag.gc | 85 +- .../jak1/engine/collide/collide-func-h.gc | 3 +- goal_src/jak1/engine/collide/collide-func.gc | 168 +- goal_src/jak1/engine/collide/collide-h.gc | 3 +- .../jak1/engine/collide/collide-mesh-h.gc | 89 +- goal_src/jak1/engine/collide/collide-mesh.gc | 154 +- goal_src/jak1/engine/collide/collide-probe.gc | 299 +- .../jak1/engine/collide/collide-shape-h.gc | 599 ++- .../engine/collide/collide-shape-rider.gc | 428 +- goal_src/jak1/engine/collide/collide-shape.gc | 2351 +++------- .../jak1/engine/collide/collide-target-h.gc | 351 +- .../jak1/engine/collide/collide-touch-h.gc | 154 +- goal_src/jak1/engine/collide/collide-touch.gc | 511 +-- goal_src/jak1/engine/collide/collide.gc | 39 +- goal_src/jak1/engine/collide/main-collide.gc | 312 +- goal_src/jak1/engine/collide/pat-h.gc | 116 +- goal_src/jak1/engine/collide/surface-h.gc | 2077 +++++---- goal_src/jak1/engine/common-obs/babak.gc | 408 +- goal_src/jak1/engine/common-obs/basebutton.gc | 836 ++-- goal_src/jak1/engine/common-obs/baseplat.gc | 342 +- .../engine/common-obs/collectables-part.gc | 3823 ++++++++--------- .../jak1/engine/common-obs/collectables.gc | 3302 +++++--------- goal_src/jak1/engine/common-obs/crates.gc | 1766 +++----- 27 files changed, 7839 insertions(+), 12766 deletions(-) diff --git a/goal_src/jak1/engine/collide/collide-cache.gc b/goal_src/jak1/engine/collide/collide-cache.gc index 7b359e0bb9..db6ca05a36 100644 --- a/goal_src/jak1/engine/collide/collide-cache.gc +++ b/goal_src/jak1/engine/collide/collide-cache.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/gfx/background/subdivide.gc") (require "engine/collide/collide-func.gc") (require "examples/debug-collide.gc") @@ -24,49 +23,32 @@ (let ((gp-0 (the-as collide-cache-tri (-> obj tris)))) (countdown (s4-0 (-> obj num-tris)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> gp-0 pat mode) color) a 64))) - (add-debug-flat-triangle - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> gp-0 vertex)) - (-> gp-0 vertex 1) - (-> gp-0 vertex 2) - t1-0 - ) + (add-debug-flat-triangle #t + (bucket-id debug-no-zbuf) + (the-as vector (-> gp-0 vertex)) + (-> gp-0 vertex 1) + (-> gp-0 vertex 2) + t1-0) (#when PC_PORT - (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) (-> gp-0 vertex 0) (-> gp-0 vertex 1) (-> gp-0 vertex 2) - (static-rgba 0 0 0 64) - ) - ) - ) - (&+! gp-0 64) - ) - ) + (add-debug-outline-triangle #t + (bucket-id debug-no-zbuf) + (-> gp-0 vertex 0) + (-> gp-0 vertex 1) + (-> gp-0 vertex 2) + (static-rgba 0 0 0 64)))) + (&+! gp-0 64))) (let ((gp-1 (the-as collide-cache-prim (-> obj prims)))) (countdown (s5-1 (-> obj num-prims)) (when (= (-> gp-1 prim-core prim-type) -1) - (let ((t0-1 - (copy-and-set-field - (-> *pat-mode-info* (-> (the-as collide-shape-prim-sphere (-> gp-1 prim)) pat mode) color) - a - 64 - ) - ) - ) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> gp-1 prim-core)) - (-> gp-1 prim-core world-sphere w) - t0-1 - ) - ) - ) - (&+! gp-1 48) - ) - ) + (let ((t0-1 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-shape-prim-sphere (-> gp-1 prim)) pat mode) color) a 64))) + (add-debug-sphere #t + (bucket-id debug-no-zbuf) + (the-as vector (-> gp-1 prim-core)) + (-> gp-1 prim-core world-sphere w) + t0-1))) + (&+! gp-1 48))) 0 - (none) - ) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;; ;; Setup @@ -80,9 +62,7 @@ (set! (-> obj num-prims) 0) (set! (-> obj proc) #f) (set! *already-printed-exeeded-max-cache-tris* #f) - (none) - ) - + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Fill using Bounding Box @@ -96,36 +76,40 @@ ;; 4). We run the filter by box function to download only tris in the box into the cache. (defmethod-mips2c "(method 26 collide-cache)" 26 collide-cache) + (defmethod-mips2c "(method 27 collide-cache)" 27 collide-cache) + (defmethod-mips2c "(method 28 collide-cache)" 28 collide-cache) + (defmethod-mips2c "(method 29 collide-cache)" 29 collide-cache) + (defmethod-mips2c "(method 32 collide-cache)" 32 collide-cache) + (defmethod-mips2c "(method 12 collide-shape-prim-mesh)" 12 collide-shape-prim-mesh) + (defmethod-mips2c "(method 14 collide-shape-prim-mesh)" 14 collide-shape-prim-mesh) + (defmethod-mips2c "(method 13 collide-shape-prim-mesh)" 13 collide-shape-prim-mesh) + (defmethod-mips2c "(method 30 collide-cache)" 30 collide-cache) + (defmethod-mips2c "(method 9 collide-cache-prim)" 9 collide-cache-prim) + (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) + (defmethod-mips2c "(method 9 collide-puss-work)" 9 collide-puss-work) + (defmethod-mips2c "(method 10 collide-puss-work)" 10 collide-puss-work) + (def-mips2c __pc-upload-collide-frag (function object object object none)) - -(defmethod fill-from-background ((obj collide-cache) - (bsp-find-mesh-func (function bsp-header int collide-list none)) - (import-mesh-func (function collide-cache object none)) - ) +(defmethod fill-from-background ((obj collide-cache) (bsp-find-mesh-func (function bsp-header int collide-list none)) (import-mesh-func (function collide-cache object none))) "This terrible function fills the collide cache with background tris from a bounding box." - (local-vars (a0-4 int) (a0-6 int)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Step 1: Build Collide List ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; this is a list of fragments that we will look at. - - (set! (-> *collide-list* num-items) 0) (cond ((= bsp-find-mesh-func (method-of-type bsp-header collide-ray)) @@ -135,70 +119,44 @@ (when (= (-> a0-2 status) 'active) (reset! (-> *perf-stats* data 14)) (collide-probe-make-list a0-2 *collide-list*) - (read! (-> *perf-stats* data 14)) - ) - ) - ) - ) + (read! (-> *perf-stats* data 14)))))) (else - ;; for the othes, we don't have a fancy version, so use the versio provided by the user. - (dotimes (s3-0 (-> *level* length)) - (let ((v1-21 (-> *level* level s3-0))) - (if (= (-> v1-21 status) 'active) - (bsp-find-mesh-func (-> v1-21 bsp) 0 *collide-list*) - ) - ) - ) - ) - ) - - + ;; for the othes, we don't have a fancy version, so use the versio provided by the user. + (dotimes (s3-0 (-> *level* length)) + (let ((v1-21 (-> *level* level s3-0))) + (if (= (-> v1-21 status) 'active) (bsp-find-mesh-func (-> v1-21 bsp) 0 *collide-list*)))))) (when (> (-> *collide-list* num-items) 0) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Step 2: Upload to VU0 Data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; in classic ND style, this is double buffered. ;; we'll undo this. (dotimes (i (-> *collide-list* num-items)) (let ((frag (-> *collide-list* items i))) - ;; to VU0 memory - (__pc-upload-collide-frag (-> frag mesh packed-data) (-> frag mesh vertex-data-qwc) (-> frag mesh vertex-count)) - ;; from VU0 memory to scratchpad - (unpack-background-collide-mesh obj (-> frag mesh) (-> frag inst) 0) - ;; from scratchpad to collide-cache memory. - (import-mesh-func obj (-> frag mesh)) - ) - ) - + ;; to VU0 memory + (__pc-upload-collide-frag (-> frag mesh packed-data) (-> frag mesh vertex-data-qwc) (-> frag mesh vertex-count)) + ;; from VU0 memory to scratchpad + (unpack-background-collide-mesh obj (-> frag mesh) (-> frag inst) 0) + ;; from scratchpad to collide-cache memory. + (import-mesh-func obj (-> frag mesh)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Fake it as a prim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; The old system can actually read out lists of prims. ;; Note that this assumes the cache has been emptied and we're the first to fill it here. - (let ((a0-28 (-> obj num-tris))) (when (> a0-28 0) (let ((v1-55 (-> obj prims)) - (a1-17 *collide-shape-prim-backgnd*) - ) + (a1-17 *collide-shape-prim-backgnd*)) (set! (-> v1-55 0 num-tris) (the-as uint a0-28)) (set! (-> v1-55 0 prim) a1-17) (set! (-> obj num-prims) 1) (set! (-> v1-55 0 first-tri) (the-as uint 0)) (set! (-> v1-55 0 ccache) obj) (set! (-> v1-55 0 prim-core world-sphere quad) (-> a1-17 prim-core world-sphere quad)) - (set! (-> v1-55 0 prim-core quad 1) (-> a1-17 prim-core quad 1)) - ) - ) - ) - - ) + (set! (-> v1-55 0 prim-core quad 1) (-> a1-17 prim-core quad 1)))))) 0 - (none) - ) + (none)) (defmethod fill-from-water ((obj collide-cache) (arg0 water-control)) (rlet ((vf0 :class vf) @@ -206,47 +164,26 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (init-vf0-vector) (when (= (-> obj num-prims) 100) - (if (= *cheat-mode* 'debug) - (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") - ) - (return #f) - ) + (if (= *cheat-mode* 'debug) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%")) + (return #f)) (when (< *collide-cache-max-tris* (+ (-> obj num-tris) 2)) (when (not *already-printed-exeeded-max-cache-tris*) (set! *already-printed-exeeded-max-cache-tris* #t) - (if (= *cheat-mode* 'debug) - (format *stdcon* "Exceeded collide cache max # of tris!~%") - ) - ) - (return #f) - ) - (if (not - (and (logtest? (-> arg0 flags) 2) (logtest? (-> arg0 flags) 144) (zero? (logand #x10000 (-> arg0 flags)))) - ) - (return #f) - ) + (if (= *cheat-mode* 'debug) (format *stdcon* "Exceeded collide cache max # of tris!~%"))) + (return #f)) + (if (not (and (logtest? (-> arg0 flags) 2) (logtest? (-> arg0 flags) 144) (zero? (logand #x10000 (-> arg0 flags))))) + (return #f)) (let ((v1-28 (cond - ((logtest? (-> *target* control root-prim prim-core action) (collide-action racer)) - (+ -819.2 (-> arg0 height)) - ) - ((logtest? (-> arg0 flags) 16) - (- (-> arg0 height) (-> arg0 swim-height)) - ) - (else - (- (-> arg0 base-height) (-> arg0 bottom-height)) - ) - ) - ) - ) + ((logtest? (-> *target* control root-prim prim-core action) (collide-action racer)) (+ -819.2 (-> arg0 height))) + ((logtest? (-> arg0 flags) 16) (- (-> arg0 height) (-> arg0 swim-height))) + (else (- (-> arg0 base-height) (-> arg0 bottom-height)))))) (.lvf vf1 (&-> obj collide-box min quad)) (.lvf vf3 (&-> obj collide-box max quad)) (let ((a1-6 (-> obj num-prims-u)) - (a2-8 (the-as (inline-array collide-cache-tri) (-> obj tris (-> obj num-tris)))) - ) + (a2-8 (the-as (inline-array collide-cache-tri) (-> obj tris (-> obj num-tris))))) (.mov vf5 v1-28) (.add.x.vf vf1 vf0 vf5 :mask #b10) (set! (-> a2-8 0 extra-quad) (the-as uint128 0)) @@ -265,24 +202,18 @@ (.svf (&-> a2-8 1 vertex 0 quad) vf1) (.svf (&-> a2-8 1 vertex 1 quad) vf3) (.svf (&-> a2-8 1 vertex 2 quad) vf4) - (set! (-> a2-8 1 pat) (new 'static 'pat-surface :material (pat-material waterbottom))) - ) - ) + (set! (-> a2-8 1 pat) (new 'static 'pat-surface :material (pat-material waterbottom))))) (let ((v1-33 *collide-shape-prim-water*) - (a1-10 (-> obj prims (-> obj num-prims))) - ) + (a1-10 (-> obj prims (-> obj num-prims)))) (set! (-> a1-10 first-tri) (the-as uint (-> obj num-tris))) (set! (-> a1-10 num-tris) (the-as uint 2)) (set! (-> a1-10 prim) v1-33) (set! (-> a1-10 ccache) obj) (set! (-> a1-10 prim-core world-sphere quad) (-> v1-33 prim-core world-sphere quad)) - (set! (-> a1-10 prim-core quad 1) (-> v1-33 prim-core quad 1)) - ) + (set! (-> a1-10 prim-core quad 1) (-> v1-33 prim-core quad 1))) (+! (-> obj num-prims) 1) (+! (-> obj num-tris) 2) - (none) - ) - ) + (none))) (defmethod fill-using-bounding-box ((obj collide-cache) (arg0 bounding-box) (arg1 collide-kind) (arg2 process-drawable) (arg3 pat-surface)) (rlet ((Q :class vf) @@ -293,8 +224,7 @@ (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) - (vf7 :class vf) - ) + (vf7 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'static 'vector :x 0.5))) (nop!) @@ -332,27 +262,16 @@ (.sub.vf vf5 vf5 Q :mask #b1000) (set! (-> obj collide-with) arg1) (nop!) - (.svf (&-> a0-1 collide-sphere-neg-r quad) vf5) - ) - ) + (.svf (&-> a0-1 collide-sphere-neg-r quad) vf5))) 0 (if (logtest? arg1 (collide-kind background)) - (fill-from-background - obj - (method-of-type bsp-header collide-with-box) - (method-of-type collide-cache load-mesh-from-spad-in-box) - ) - ) - (if (logtest? arg1 (collide-kind water)) - (fill-from-water obj (-> arg2 water)) - ) - (if (logtest? arg1 (collide-kind cak-1 cak-2 cak-3 target)) - (fill-from-foreground-using-box obj) - ) + (fill-from-background obj + (method-of-type bsp-header collide-with-box) + (method-of-type collide-cache load-mesh-from-spad-in-box))) + (if (logtest? arg1 (collide-kind water)) (fill-from-water obj (-> arg2 water))) + (if (logtest? arg1 (collide-kind cak-1 cak-2 cak-3 target)) (fill-from-foreground-using-box obj)) 0 - (none) - ) - ) + (none))) (defun collide-cache-using-box-test ((arg0 vector)) (local-vars (v1-1 int)) @@ -360,61 +279,43 @@ (vf0 :class vf) (vf1 :class vf) (vf2 :class vf) - (vf3 :class vf) - ) - (init-vf0-vector) - (nop!) - (.max.w.vf vf3 vf0 vf0) - (let ((v1-0 *collide-work*)) + (vf3 :class vf)) + (init-vf0-vector) (nop!) - (.lvf vf1 (&-> arg0 quad)) + (.max.w.vf vf3 vf0 vf0) + (let ((v1-0 *collide-work*)) (nop!) (.lvf vf1 (&-> arg0 quad)) (nop!) (.lvf vf2 (&-> v1-0 collide-sphere-neg-r quad))) + (.sub.vf vf1 vf1 vf2) (nop!) - (.lvf vf2 (&-> v1-0 collide-sphere-neg-r quad)) - ) - (.sub.vf vf1 vf1 vf2) - (nop!) - (.mul.vf vf1 vf1 vf1) - (nop!) - (.mul.x.vf acc vf3 vf1) - (nop!) - (.add.mul.y.vf acc vf3 vf1 acc) - (nop!) - (.add.mul.z.vf acc vf3 vf1 acc) - (nop!) - (.sub.mul.w.vf vf1 vf3 vf1 acc) - (nop!) - (.mov v1-1 vf1) - (<= (the-as int v1-1) 0) - ) - ) + (.mul.vf vf1 vf1 vf1) + (nop!) + (.mul.x.vf acc vf3 vf1) + (nop!) + (.add.mul.y.vf acc vf3 vf1 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf1 acc) + (nop!) + (.sub.mul.w.vf vf1 vf3 vf1 acc) + (nop!) + (.mov v1-1 vf1) + (<= (the-as int v1-1) 0))) (defmethod collide-with-box ((obj collide-fragment) (arg0 int) (arg1 collide-list)) (let ((s3-0 *collide-work*)) (dotimes (s2-0 arg0) - (when (and (collide-cache-using-box-test (-> obj bsphere)) - (drawable-sphere-box-intersect? obj (-> s3-0 collide-box4w)) - ) - (let ((v1-5 (-> arg1 items (-> arg1 num-items)))) - (set! (-> v1-5 mesh) (-> obj mesh)) - (set! (-> v1-5 inst) #f) - ) + (when (and (collide-cache-using-box-test (-> obj bsphere)) (drawable-sphere-box-intersect? obj (-> s3-0 collide-box4w))) + (let ((v1-5 (-> arg1 items (-> arg1 num-items)))) (set! (-> v1-5 mesh) (-> obj mesh)) (set! (-> v1-5 inst) #f)) ; (add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :g #x80 :a #x80)) ; (format 0 "~f~%" (-> obj bsphere w)) - (+! (-> arg1 num-items) 1) - ) - (&+! obj 32) - ) - ) + (+! (-> arg1 num-items) 1)) + (&+! obj 32))) 0 - (none) - ) + (none)) (defmethod collide-with-box ((obj instance-tie) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (when (and (zero? (logand (-> obj flags) 1)) (collide-cache-using-box-test (-> obj bsphere)) - (drawable-sphere-box-intersect? obj (-> *collide-work* collide-box4w)) - ) + (drawable-sphere-box-intersect? obj (-> *collide-work* collide-box4w))) (let ((s2-0 (-> obj bucket-ptr collide-frag))) (when (nonzero? s2-0) (let ((s1-0 (the-as object (-> s2-0 data)))) @@ -422,22 +323,12 @@ (when (instance-sphere-box-intersect? (the-as collide-fragment s1-0) obj (-> *collide-work* collide-box4w)) (let ((v1-12 (-> arg1 items (-> arg1 num-items)))) (set! (-> v1-12 mesh) (-> (the-as collide-fragment s1-0) mesh)) - (set! (-> v1-12 inst) obj) - ) - (+! (-> arg1 num-items) 1) - ) - (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1)) - ) - ) - ) - ) - ) - (&+! obj 64) - ) + (set! (-> v1-12 inst) obj)) + (+! (-> arg1 num-items) 1)) + (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1))))))) + (&+! obj 64)) 0 - (none) - ) - + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Y PROBE @@ -448,53 +339,42 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) - (set! *already-printed-exeeded-max-cache-tris* #f) - (.mov vf5 arg1) - (.lvf vf2 (&-> arg0 quad)) - (nop!) - (let ((v1-0 *collide-work*)) - (.mov.vf vf1 vf2) - (set! (-> obj ignore-mask) (the-as pat-surface arg4)) - (.add.x.vf vf2 vf2 vf5 :mask #b10) - (set! (-> obj num-tris) 0) - (.sub.x.vf vf1 vf1 vf5 :mask #b10) - (set! (-> obj num-prims) 0) - (nop!) - (set! (-> obj collide-with) arg2) - (nop!) - (set! (-> obj proc) arg3) - (.ftoi.vf vf4 vf2) - (.svf (&-> obj collide-box max quad) vf2) - (.ftoi.vf vf3 vf1) - (.svf (&-> obj collide-box min quad) vf1) - (nop!) - (.svf (&-> obj collide-box4w max quad) vf4) - (nop!) - (.svf (&-> obj collide-box4w min quad) vf3) - (nop!) - (.svf (&-> v1-0 collide-box4w max quad) vf4) - (nop!) - (.svf (&-> v1-0 collide-box4w min quad) vf3) - ) - (if (logtest? arg2 (collide-kind background)) - (fill-from-background - obj - (method-of-type bsp-header collide-y-probe) - (the-as (function collide-cache object none) (method-of-type collide-cache collide-cache-method-28)) - ) - ) - (if (logtest? arg2 (collide-kind water)) - (fill-from-water obj (-> arg3 water)) - ) - (if (logtest? arg2 (collide-kind cak-1 cak-2 cak-3 target)) - (fill-from-foreground-using-y-probe obj) - ) - 0 - (none) - ) - ) + (vf5 :class vf)) + (set! *already-printed-exeeded-max-cache-tris* #f) + (.mov vf5 arg1) + (.lvf vf2 (&-> arg0 quad)) + (nop!) + (let ((v1-0 *collide-work*)) + (.mov.vf vf1 vf2) + (set! (-> obj ignore-mask) (the-as pat-surface arg4)) + (.add.x.vf vf2 vf2 vf5 :mask #b10) + (set! (-> obj num-tris) 0) + (.sub.x.vf vf1 vf1 vf5 :mask #b10) + (set! (-> obj num-prims) 0) + (nop!) + (set! (-> obj collide-with) arg2) + (nop!) + (set! (-> obj proc) arg3) + (.ftoi.vf vf4 vf2) + (.svf (&-> obj collide-box max quad) vf2) + (.ftoi.vf vf3 vf1) + (.svf (&-> obj collide-box min quad) vf1) + (nop!) + (.svf (&-> obj collide-box4w max quad) vf4) + (nop!) + (.svf (&-> obj collide-box4w min quad) vf3) + (nop!) + (.svf (&-> v1-0 collide-box4w max quad) vf4) + (nop!) + (.svf (&-> v1-0 collide-box4w min quad) vf3)) + (if (logtest? arg2 (collide-kind background)) + (fill-from-background obj + (method-of-type bsp-header collide-y-probe) + (the-as (function collide-cache object none) (method-of-type collide-cache collide-cache-method-28)))) + (if (logtest? arg2 (collide-kind water)) (fill-from-water obj (-> arg3 water))) + (if (logtest? arg2 (collide-kind cak-1 cak-2 cak-3 target)) (fill-from-foreground-using-y-probe obj)) + 0 + (none))) (defun collide-cache-using-y-probe-test ((arg0 vector)) (local-vars @@ -505,14 +385,12 @@ (a0-1 uint128) (a1-2 uint128) (a2-0 uint128) - (f31-0 none) - ) + (f31-0 none)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (set! zero (the-as uint128 0)) (nop!) (let ((a1-0 *collide-work*)) @@ -532,19 +410,11 @@ (nop!) (.mov a0-1 vf5) (nop!) - (.pcgtw a1-2 a2-0 a1-1) - ) - (.pcgtw v1-1 v1-0 a0-1) - ) - ) + (.pcgtw a1-2 a2-0 a1-1)) + (.pcgtw v1-1 v1-0 a0-1))) (.por v1-2 a1-2 v1-1) (.ppach v1-3 zero v1-2) - (let ((v1-4 (shl (the-as int v1-3) 16))) - (nop!) - (zero? v1-4) - ) - ) - ) + (let ((v1-4 (shl (the-as int v1-3) 16))) (nop!) (zero? v1-4)))) ;; definition for method 12 of type collide-fragment ;; INFO: Return type mismatch int vs none. @@ -552,17 +422,11 @@ *collide-work* (dotimes (s3-0 arg0) (when (collide-cache-using-y-probe-test (-> obj bsphere)) - (let ((v1-5 (-> arg1 items (-> arg1 num-items)))) - (set! (-> v1-5 mesh) (-> obj mesh)) - (set! (-> v1-5 inst) #f) - ) - (+! (-> arg1 num-items) 1) - ) - (&+! obj 32) - ) + (let ((v1-5 (-> arg1 items (-> arg1 num-items)))) (set! (-> v1-5 mesh) (-> obj mesh)) (set! (-> v1-5 inst) #f)) + (+! (-> arg1 num-items) 1)) + (&+! obj 32)) 0 - (none) - ) + (none)) ;; definition for method 12 of type instance-tie ;; INFO: Return type mismatch int vs none. @@ -576,21 +440,12 @@ (when (instance-sphere-box-intersect? (the-as collide-fragment s1-0) obj (-> *collide-work* collide-box4w)) (let ((v1-11 (-> arg1 items (-> arg1 num-items)))) (set! (-> v1-11 mesh) (-> (the-as collide-fragment s1-0) mesh)) - (set! (-> v1-11 inst) obj) - ) - (+! (-> arg1 num-items) 1) - ) - (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1)) - ) - ) - ) - ) - ) - (&+! obj 64) - ) + (set! (-> v1-11 inst) obj)) + (+! (-> arg1 num-items) 1)) + (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1))))))) + (&+! obj 64)) 0 - (none) - ) + (none)) ;;;;;;;;;;;;;;;;;;;;; ;; Line Sphere Test @@ -602,32 +457,15 @@ (defmacro pabsw-hack (out in) `(let ((temp (new 'stack-no-clear 'array 'int32 4))) - (set! (-> (the (pointer uint128) temp)) ,in) - (set! (-> temp 0) (abs (-> temp 0))) - (set! (-> temp 1) (abs (-> temp 1))) - (set! (-> temp 2) (abs (-> temp 2))) - (set! (-> temp 3) (abs (-> temp 3))) - (set! ,out (-> (the (pointer uint128) temp))) - ) - ) + (set! (-> (the (pointer uint128) temp)) ,in) + (set! (-> temp 0) (abs (-> temp 0))) + (set! (-> temp 1) (abs (-> temp 1))) + (set! (-> temp 2) (abs (-> temp 2))) + (set! (-> temp 3) (abs (-> temp 3))) + (set! ,out (-> (the (pointer uint128) temp))))) - -(defmethod fill-using-line-sphere ((obj collide-cache) - (arg0 vector) - (arg1 vector) - (arg2 float) - (arg3 collide-kind) - (arg4 process-drawable) - (arg5 pat-surface) - ) - (local-vars - (zero uint128) - (a0-2 uint128) - (a0-3 uint128) - (a0-7 int) - (t0-1 uint128) - (t0-2 uint128) - ) +(defmethod fill-using-line-sphere ((obj collide-cache) (arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process-drawable) (arg5 pat-surface)) + (local-vars (zero uint128) (a0-2 uint128) (a0-3 uint128) (a0-7 int) (t0-1 uint128) (t0-2 uint128)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -653,8 +491,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (set! zero (the uint128 0)) (init-vf0-vector) (let ((v1-0 (new 'static 'vector4w :x #x1000 :y #x1000 :z #x1000))) @@ -671,16 +508,13 @@ (set! (-> obj ignore-mask) arg5) (.mov t0-1 vf21) (nop!) - (pabsw-hack t0-2 t0-1) ;; t0-2 is the line, absolute value + (pabsw-hack t0-2 t0-1) ;; t0-2 is the line, absolute value (.pcgtw a0-2 t0-2 a0-1) (.ppach a0-3 zero a0-2) - (let ((a0-4 (shl (the-as int a0-3) 16))) - (b! (nonzero? a0-4) cfg-3) - ) + (let ((a0-4 (shl (the-as int a0-3) 16))) (b! (nonzero? a0-4) cfg-3)) (let ((s2-0 (new 'stack-no-clear 'bounding-box))) (set-from-point-offset-pad! s2-0 (the-as vector3s arg0) (the-as vector3s arg1) arg2) - (fill-using-bounding-box obj s2-0 arg3 arg4 arg5) - ) + (fill-using-bounding-box obj s2-0 arg3 arg4 arg5)) (b! #t cfg-13 :delay (nop!)) (set! v1-1 (the-as collide-work 0)) (label cfg-3) @@ -746,42 +580,22 @@ (.svf (&-> v1-1 inv-mat vector 1 quad) vf18) (.sub.vf vf20 vf0 vf20) (.svf (&-> v1-1 inv-mat vector 2 quad) vf19) - (.svf (&-> v1-1 inv-mat vector 3 quad) vf20) - ) - ) - ) + (.svf (&-> v1-1 inv-mat vector 3 quad) vf20)))) 0 (if (logtest? arg3 (collide-kind background)) - (fill-from-background - obj - (method-of-type bsp-header collide-ray) - (the-as (function collide-cache object none) (method-of-type collide-cache collide-cache-method-27)) - ) - ) - (if (logtest? arg3 (collide-kind water)) - (fill-from-water obj (-> arg4 water)) - ) - (if (logtest? arg3 (collide-kind cak-1 cak-2 cak-3 target)) - (fill-from-foreground-using-line-sphere obj) - ) + (fill-from-background obj + (method-of-type bsp-header collide-ray) + (the-as (function collide-cache object none) (method-of-type collide-cache collide-cache-method-27)))) + (if (logtest? arg3 (collide-kind water)) (fill-from-water obj (-> arg4 water))) + (if (logtest? arg3 (collide-kind cak-1 cak-2 cak-3 target)) (fill-from-foreground-using-line-sphere obj)) 0 (label cfg-13) - (none) - ) - ) + (none))) (defun collide-cache-using-line-sphere-test ((arg0 vector)) "Check if the input sphere is in the rotated bounding box volume of the current line-sphere query." - (local-vars - (v1-1 uint128) - (v1-2 uint128) - (v1-3 uint128) - (a0-1 uint128) - (a1-2 uint128) - (a2-0 uint128) - (zero uint128) - ) + (local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128) (a0-1 uint128) (a1-2 uint128) (a2-0 uint128) (zero uint128)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -793,8 +607,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (set! zero (the uint128 0)) (let ((a1-0 *collide-work*)) @@ -815,30 +628,48 @@ (.ftoi.vf vf9 vf7) (.mov a2-0 vf8) (.mov a0-1 vf9) - (.pcgtw a1-2 a2-0 a1-1) - ) - (.pcgtw v1-1 v1-0 a0-1) - ) - ) + (.pcgtw a1-2 a2-0 a1-1)) + (.pcgtw v1-1 v1-0 a0-1))) (.por v1-2 a1-2 v1-1) (.ppach v1-3 zero v1-2) - (let ((v1-4 (shl (the-as int v1-3) 16))) - (nop!) - (zero? v1-4) - ) - ) - ) - + (let ((v1-4 (shl (the-as int v1-3) 16))) (nop!) (zero? v1-4)))) (defun make-collide-list-using-line-sphere-inst-test ((arg0 collide-fragment) (arg1 instance-tie)) "Check if a collide-fragment at a given instance is in the rotated bounding box volume of the current line-sphere query." - (local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128) (v1-4 uint128) (a1-2 uint128) (a2-1 uint128) - (a3-1 uint128) (a3-3 uint128) (a3-4 uint128) (t0-1 uint128) (t0-2 uint128) (t1-0 uint128) (t2-1 uint128) - (t2-2 uint128) (zero uint128)) - (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) (vf10 :class vf) (vf11 :class vf) (vf12 :class vf) - (vf13 :class vf) (vf14 :class vf) (vf15 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) (vf9 :class vf)) + (local-vars + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (v1-4 uint128) + (a1-2 uint128) + (a2-1 uint128) + (a3-1 uint128) + (a3-3 uint128) + (a3-4 uint128) + (t0-1 uint128) + (t0-2 uint128) + (t1-0 uint128) + (t2-1 uint128) + (t2-2 uint128) + (zero uint128)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf)) (init-vf0-vector) (set! zero (the uint128 0)) (let ((v1-0 *collide-work*)) @@ -855,17 +686,12 @@ (.mov vf4 t1-0) (.pw.sra t0-2 t0-1 16) (.mov vf1 t2-2) - (.pextlh a3-3 a3-2 zero) - ) - ) - ) - ) + (.pextlh a3-3 a3-2 zero))))) (.mov vf2 t0-2) (.pw.sra a3-4 a3-3 16) (.lvf vf5 (&-> arg1 bsphere quad)) (.mov vf3 a3-4) - (.mov vf6 a2-0) - ) + (.mov vf6 a2-0)) (.itof.vf vf4 vf4) (vitof12.xyzw vf1 vf1) (vitof12.xyzw vf2 vf2) @@ -894,20 +720,11 @@ (.ftoi.vf vf13 vf11) (.mov v1-1 vf14) (.mov a2-1 vf13) - (.pcgtw a1-2 a2-1 a1-1) - ) - (.pcgtw v1-2 a0-1 v1-1) - ) - ) + (.pcgtw a1-2 a2-1 a1-1)) + (.pcgtw v1-2 a0-1 v1-1))) (.por v1-3 a1-2 v1-2) (.ppach v1-4 zero v1-3) - (let ((v1-5 (shl (the-as int v1-4) 16))) - (nop!) - (zero? v1-5) - ) - ) - ) - + (let ((v1-5 (shl (the-as int v1-4) 16))) (nop!) (zero? v1-5)))) (defmethod collide-ray ((obj collide-fragment) (arg0 int) (arg1 collide-list)) "Inline-array function to do line-sphere with non-instanced fragments. @@ -915,7 +732,6 @@ to the given collide-list. Note: collide-probe is the faster implementation of this." *collide-work* - ;; just iterate over all and check their bsphere. (dotimes (s3-0 arg0) (when (collide-cache-using-line-sphere-test (-> obj bsphere)) @@ -923,21 +739,16 @@ (set! (-> v1-5 mesh) (-> obj mesh)) (set! (-> v1-5 inst) #f) ;; non-instanced. ) - (+! (-> arg1 num-items) 1) - ) - (&+! obj 32) - ) + (+! (-> arg1 num-items) 1)) + (&+! obj 32)) 0 - (none) - ) - + (none)) (defmethod collide-ray ((obj instance-tie) (arg0 int) (arg1 collide-list)) "Inline-array function to do line-sphere with TIE instances. If the bsphere of the mesh is in the non-aligned bounding box, the mesh will be added to the given collide-list. Note: collide-probe is the faster implementation of this." - ;; loop over instance-ties (dotimes (s3-0 arg0) ;; first check the instance-tie's bsphere @@ -951,22 +762,12 @@ (when (make-collide-list-using-line-sphere-inst-test (the-as collide-fragment s1-0) obj) (let ((v1-10 (-> arg1 items (-> arg1 num-items)))) (set! (-> v1-10 mesh) (-> (the-as collide-fragment s1-0) mesh)) - (set! (-> v1-10 inst) obj) - ) - (+! (-> arg1 num-items) 1) - ) - (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1)) - ) - ) - ) - ) - ) - (&+! obj 64) - ) + (set! (-> v1-10 inst) obj)) + (+! (-> arg1 num-items) 1)) + (set! s1-0 (-> (the-as (inline-array collide-fragment) s1-0) 1))))))) + (&+! obj 64)) 0 - (none) - ) - + (none)) ;;;;;;;;;;;;;;;;;;; ;; foreground box @@ -1010,33 +811,25 @@ (a3-5 uint128) (a3-6 uint128) (a3-7 uint128) - (f31-0 none) - ) + (f31-0 none)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (set! zero (the-as uint128 0)) (let ((s5-0 (the-as uint128 (-> obj collide-with))) (s4-0 (-> obj collide-box4w min quad)) - (s3-0 (-> obj collide-box4w max quad)) - ) - (let ((v1-1 (the-as uint128 (make-u128 0 16)))) - (.pand v1-2 v1-1 s5-0) - ) + (s3-0 (-> obj collide-box4w max quad))) + (let ((v1-1 (the-as uint128 (make-u128 0 16)))) (.pand v1-2 v1-1 s5-0)) (when (nonzero? (the-as int v1-2)) (let ((v1-5 (-> *collide-player-list* alive-list next0))) *collide-player-list* (let ((s2-0 (-> v1-5 next0))) (while (!= v1-5 (-> *collide-player-list* alive-list-end)) (let* ((v1-6 (the-as collide-shape (-> (the-as connection v1-5) param1))) - (a0-3 (-> v1-6 root-prim)) - ) - (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) - (.pand a1-1 s5-0 a1-0) - ) + (a0-3 (-> v1-6 root-prim))) + (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) (.pand a1-1 s5-0 a1-0)) (b! (zero? (the-as int a1-1)) cfg-7) (nop!) (.lvf vf1 (&-> a0-3 prim-core world-sphere quad)) @@ -1056,43 +849,26 @@ (.pcgtw a3-1 s4-0 a3-0) (.por a2-2 a2-1 a3-1) (.ppach a2-3 zero a2-2) - (let ((a2-4 (shl (the-as int a2-3) 16))) - (nop!) - (b! (nonzero? a2-4) cfg-6 :delay (nop!)) - ) - (b! (= a1-3 v1-7) cfg-6 :delay (nop!)) - ) - ) - (add-fg-prim-using-box a0-3 obj) - ) + (let ((a2-4 (shl (the-as int a2-3) 16))) (nop!) (b! (nonzero? a2-4) cfg-6 :delay (nop!))) + (b! (= a1-3 v1-7) cfg-6 :delay (nop!)))) + (add-fg-prim-using-box a0-3 obj)) (label cfg-6) 0 (label cfg-7) (set! v1-5 s2-0) *collide-player-list* - (set! s2-0 (-> s2-0 next0)) - ) - ) - ) - ) - (let ((v1-14 (the-as uint128 (make-u128 0 14)))) - (.pand v1-15 v1-14 s5-0) - ) + (set! s2-0 (-> s2-0 next0)))))) + (let ((v1-14 (the-as uint128 (make-u128 0 14)))) (.pand v1-15 v1-14 s5-0)) (when (nonzero? (the-as int v1-15)) - (let ((v1-17 (the-as uint128 (make-u128 0 2)))) - (.pand v1-18 v1-17 s5-0) - ) + (let ((v1-17 (the-as uint128 (make-u128 0 2)))) (.pand v1-18 v1-17 s5-0)) (when (nonzero? (the-as int v1-18)) (let ((v1-21 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* (let ((s2-1 (-> v1-21 next0))) (while (!= v1-21 (-> *collide-hit-by-player-list* alive-list-end)) (let* ((v1-22 (the-as collide-shape (-> (the-as connection v1-21) param1))) - (a0-10 (-> v1-22 root-prim)) - ) - (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) - (.pand a1-6 s5-0 a1-5) - ) + (a0-10 (-> v1-22 root-prim))) + (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) (.pand a1-6 s5-0 a1-5)) (b! (zero? (the-as int a1-6)) cfg-18) (nop!) (.lvf vf1 (&-> a0-10 prim-core world-sphere quad)) @@ -1112,39 +888,24 @@ (.pcgtw a3-3 s4-0 a3-2) (.por a2-7 a2-6 a3-3) (.ppach a2-8 zero a2-7) - (let ((a2-9 (shl (the-as int a2-8) 16))) - (nop!) - (b! (nonzero? a2-9) cfg-17 :delay (nop!)) - ) - (b! (= a1-8 v1-23) cfg-17 :delay (nop!)) - ) - ) - (add-fg-prim-using-box a0-10 obj) - ) + (let ((a2-9 (shl (the-as int a2-8) 16))) (nop!) (b! (nonzero? a2-9) cfg-17 :delay (nop!))) + (b! (= a1-8 v1-23) cfg-17 :delay (nop!)))) + (add-fg-prim-using-box a0-10 obj)) (label cfg-17) 0 (label cfg-18) (set! v1-21 s2-1) *collide-hit-by-player-list* - (set! s2-1 (-> s2-1 next0)) - ) - ) - ) - ) - (let ((v1-30 (the-as uint128 (make-u128 0 4)))) - (.pand v1-31 v1-30 s5-0) - ) + (set! s2-1 (-> s2-1 next0)))))) + (let ((v1-30 (the-as uint128 (make-u128 0 4)))) (.pand v1-31 v1-30 s5-0)) (when (nonzero? (the-as int v1-31)) (let ((v1-34 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((s2-2 (-> v1-34 next0))) (while (!= v1-34 (-> *collide-usually-hit-by-player-list* alive-list-end)) (let* ((v1-35 (the-as collide-shape (-> (the-as connection v1-34) param1))) - (a0-17 (-> v1-35 root-prim)) - ) - (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) - (.pand a1-11 s5-0 a1-10) - ) + (a0-17 (-> v1-35 root-prim))) + (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) (.pand a1-11 s5-0 a1-10)) (b! (zero? (the-as int a1-11)) cfg-28) (nop!) (nop!) @@ -1165,39 +926,24 @@ (.pcgtw a3-5 s4-0 a3-4) (.por a2-12 a2-11 a3-5) (.ppach a2-13 zero a2-12) - (let ((a2-14 (shl (the-as int a2-13) 16))) - (nop!) - (b! (nonzero? a2-14) cfg-27 :delay (nop!)) - ) - (b! (= a1-13 v1-36) cfg-27 :delay (nop!)) - ) - ) - (add-fg-prim-using-box a0-17 obj) - ) + (let ((a2-14 (shl (the-as int a2-13) 16))) (nop!) (b! (nonzero? a2-14) cfg-27 :delay (nop!))) + (b! (= a1-13 v1-36) cfg-27 :delay (nop!)))) + (add-fg-prim-using-box a0-17 obj)) (label cfg-27) 0 (label cfg-28) (set! v1-34 s2-2) *collide-usually-hit-by-player-list* - (set! s2-2 (-> s2-2 next0)) - ) - ) - ) - ) - (let ((v1-43 (the-as uint128 (make-u128 0 8)))) - (.pand v1-44 v1-43 s5-0) - ) + (set! s2-2 (-> s2-2 next0)))))) + (let ((v1-43 (the-as uint128 (make-u128 0 8)))) (.pand v1-44 v1-43 s5-0)) (when (nonzero? (the-as int v1-44)) (let ((v1-46 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((s2-3 (-> v1-46 next0))) (while (!= v1-46 (-> *collide-hit-by-others-list* alive-list-end)) (let* ((v1-47 (the-as collide-shape (-> (the-as connection v1-46) param1))) - (a0-24 (-> v1-47 root-prim)) - ) - (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) - (.pand a1-16 s5-0 a1-15) - ) + (a0-24 (-> v1-47 root-prim))) + (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) (.pand a1-16 s5-0 a1-15)) (b! (zero? (the-as int a1-16)) cfg-38) (nop!) (nop!) @@ -1218,35 +964,20 @@ (.pcgtw a3-7 s4-0 a3-6) (.por a2-17 a2-16 a3-7) (.ppach a2-18 zero a2-17) - (let ((a2-19 (shl (the-as int a2-18) 16))) - (nop!) - (b! (nonzero? a2-19) cfg-37 :delay (nop!)) - ) - (b! (= a1-18 v1-48) cfg-37 :delay (nop!)) - ) - ) - (add-fg-prim-using-box a0-24 obj) - ) + (let ((a2-19 (shl (the-as int a2-18) 16))) (nop!) (b! (nonzero? a2-19) cfg-37 :delay (nop!))) + (b! (= a1-18 v1-48) cfg-37 :delay (nop!)))) + (add-fg-prim-using-box a0-24 obj)) (label cfg-37) 0 (label cfg-38) (set! v1-46 s2-3) *collide-hit-by-others-list* - (set! s2-3 (-> s2-3 next0)) - ) - ) - ) - ) - ) - ) - (none) - ) - ) + (set! s2-3 (-> s2-3 next0)))))))) + (none))) (defmethod add-fg-prim-using-box ((obj collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") - (none) - ) + (none)) (defmethod add-fg-prim-using-box ((obj collide-shape-prim-sphere) (arg0 collide-cache)) (local-vars (t1-1 uint)) @@ -1256,8 +987,7 @@ (t1-0 100) (v1-0 (-> obj prim-core world-sphere quad)) (t2-0 (* a3-0 2)) - (a2-0 (-> obj prim-core quad 1)) - ) + (a2-0 (-> obj prim-core quad 1))) (b! (= a3-0 t1-0) cfg-2 :delay (set! t1-1 (+ t2-0 a3-0))) (let ((t0-1 (the-as object (&-> t0-0 0 prim-core quad t1-1)))) (let ((a3-1 (+ a3-0 1))) @@ -1269,18 +999,14 @@ (nop!) (set! (-> (the-as collide-cache-prim t0-1) prim-core quad 1) a2-0) (nop!) - (set! (-> arg0 num-prims) (the-as int a3-1)) - ) + (set! (-> arg0 num-prims) (the-as int a3-1))) (nop!) - (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0) - ) - ) + (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") (label cfg-3) - (none) - ) + (none)) (defmethod add-fg-prim-using-box ((obj collide-shape-prim-group) (arg0 collide-cache)) (local-vars @@ -1291,19 +1017,16 @@ (v1-5 uint128) (a0-1 collide-shape-prim) (a1-1 uint128) - (a1-2 uint128) - ) + (a1-2 uint128)) (set! zero (the-as uint128 0)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (nop!) (let ((s5-0 (-> obj prims)) - (s4-0 (-> obj num-prims-u)) - ) + (s4-0 (-> obj num-prims-u))) (nop!) (let ((s3-0 (-> arg0 collide-box4w min quad))) (nop!) @@ -1323,12 +1046,7 @@ (set! s5-0 (&-> s5-0 1)) (.add.w.vf vf3 vf1 vf1) (set! s1-0 (-> s5-0 0)) - (let ((v1-1 (logand s0-0 v1-0))) - (nop!) - (b! (zero? v1-1) cfg-1 :delay (nop!)) - ) - ) - ) + (let ((v1-1 (logand s0-0 v1-0))) (nop!) (b! (zero? v1-1) cfg-1 :delay (nop!))))) (.ftoi.vf vf4 vf2) (nop!) (.ftoi.vf vf5 vf3) @@ -1341,22 +1059,12 @@ (.pcgtw v1-3 s3-0 v1-2) (.por v1-4 a1-2 v1-3) (.ppach v1-5 zero v1-4) - (let ((v1-6 (shl (the-as int v1-5) 16))) - (nop!) - (b! (nonzero? v1-6) cfg-1 :delay (nop!)) - ) + (let ((v1-6 (shl (the-as int v1-5) 16))) (nop!) (b! (nonzero? v1-6) cfg-1 :delay (nop!))) (add-fg-prim-using-box a0-1 arg0) - (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)) - ) - ) - ) - ) + (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)))))) (label cfg-5) 0 - (none) - ) - ) - + (none))) ;;;;;;;;;;;;;;;;;;;;;;;;; ;; Foreground Y PROBE @@ -1397,33 +1105,25 @@ (a3-4 uint128) (a3-5 uint128) (a3-6 uint128) - (a3-7 uint128) - ) + (a3-7 uint128)) (set! zero (the uint128 0)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (let ((s5-0 (the-as uint128 (-> obj collide-with))) (s4-0 (-> obj collide-box4w min quad)) - (s3-0 (-> obj collide-box4w max quad)) - ) - (let ((v1-1 (the-as uint128 (make-u128 0 16)))) - (.pand v1-2 v1-1 s5-0) - ) + (s3-0 (-> obj collide-box4w max quad))) + (let ((v1-1 (the-as uint128 (make-u128 0 16)))) (.pand v1-2 v1-1 s5-0)) (when (nonzero? (the-as int v1-2)) (let ((v1-5 (-> *collide-player-list* alive-list next0))) *collide-player-list* (let ((s2-0 (-> v1-5 next0))) (while (!= v1-5 (-> *collide-player-list* alive-list-end)) (let* ((v1-6 (the-as collide-shape (-> (the-as connection v1-5) param1))) - (a0-3 (-> v1-6 root-prim)) - ) - (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) - (.pand a1-1 s5-0 a1-0) - ) + (a0-3 (-> v1-6 root-prim))) + (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) (.pand a1-1 s5-0 a1-0)) (b! (zero? (the-as int a1-1)) cfg-7) (.lvf vf1 (&-> a0-3 prim-core world-sphere quad)) (.sub.w.vf vf2 vf1 vf1) @@ -1438,43 +1138,26 @@ (.pcgtw a3-1 s4-0 a3-0) (.por a2-2 a2-1 a3-1) (.ppach a2-3 zero a2-2) - (let ((a2-4 (shl (the-as int a2-3) 16))) - (nop!) - (b! (nonzero? a2-4) cfg-6 :delay (nop!)) - ) - (b! (= a1-3 v1-7) cfg-6 :delay (nop!)) - ) - ) - (add-fg-prim-using-y-probe a0-3 obj) - ) + (let ((a2-4 (shl (the-as int a2-3) 16))) (nop!) (b! (nonzero? a2-4) cfg-6 :delay (nop!))) + (b! (= a1-3 v1-7) cfg-6 :delay (nop!)))) + (add-fg-prim-using-y-probe a0-3 obj)) (label cfg-6) 0 (label cfg-7) (set! v1-5 s2-0) *collide-player-list* - (set! s2-0 (-> s2-0 next0)) - ) - ) - ) - ) - (let ((v1-14 (the-as uint128 (make-u128 0 14)))) - (.pand v1-15 v1-14 s5-0) - ) + (set! s2-0 (-> s2-0 next0)))))) + (let ((v1-14 (the-as uint128 (make-u128 0 14)))) (.pand v1-15 v1-14 s5-0)) (when (nonzero? (the-as int v1-15)) - (let ((v1-17 (the-as uint128 (make-u128 0 2)))) - (.pand v1-18 v1-17 s5-0) - ) + (let ((v1-17 (the-as uint128 (make-u128 0 2)))) (.pand v1-18 v1-17 s5-0)) (when (nonzero? (the-as int v1-18)) (let ((v1-21 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* (let ((s2-1 (-> v1-21 next0))) (while (!= v1-21 (-> *collide-hit-by-player-list* alive-list-end)) (let* ((v1-22 (the-as collide-shape (-> (the-as connection v1-21) param1))) - (a0-10 (-> v1-22 root-prim)) - ) - (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) - (.pand a1-6 s5-0 a1-5) - ) + (a0-10 (-> v1-22 root-prim))) + (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) (.pand a1-6 s5-0 a1-5)) (b! (zero? (the-as int a1-6)) cfg-18) (nop!) (.lvf vf1 (&-> a0-10 prim-core world-sphere quad)) @@ -1494,39 +1177,24 @@ (.pcgtw a3-3 s4-0 a3-2) (.por a2-7 a2-6 a3-3) (.ppach a2-8 zero a2-7) - (let ((a2-9 (shl (the-as int a2-8) 16))) - (nop!) - (b! (nonzero? a2-9) cfg-17 :delay (nop!)) - ) - (b! (= a1-8 v1-23) cfg-17 :delay (nop!)) - ) - ) - (add-fg-prim-using-y-probe a0-10 obj) - ) + (let ((a2-9 (shl (the-as int a2-8) 16))) (nop!) (b! (nonzero? a2-9) cfg-17 :delay (nop!))) + (b! (= a1-8 v1-23) cfg-17 :delay (nop!)))) + (add-fg-prim-using-y-probe a0-10 obj)) (label cfg-17) 0 (label cfg-18) (set! v1-21 s2-1) *collide-hit-by-player-list* - (set! s2-1 (-> s2-1 next0)) - ) - ) - ) - ) - (let ((v1-30 (the-as uint128 (make-u128 0 4)))) - (.pand v1-31 v1-30 s5-0) - ) + (set! s2-1 (-> s2-1 next0)))))) + (let ((v1-30 (the-as uint128 (make-u128 0 4)))) (.pand v1-31 v1-30 s5-0)) (when (nonzero? (the-as int v1-31)) (let ((v1-34 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((s2-2 (-> v1-34 next0))) (while (!= v1-34 (-> *collide-usually-hit-by-player-list* alive-list-end)) (let* ((v1-35 (the-as collide-shape (-> (the-as connection v1-34) param1))) - (a0-17 (-> v1-35 root-prim)) - ) - (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) - (.pand a1-11 s5-0 a1-10) - ) + (a0-17 (-> v1-35 root-prim))) + (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) (.pand a1-11 s5-0 a1-10)) (b! (zero? (the-as int a1-11)) cfg-28) (nop!) (nop!) @@ -1547,39 +1215,24 @@ (.pcgtw a3-5 s4-0 a3-4) (.por a2-12 a2-11 a3-5) (.ppach a2-13 zero a2-12) - (let ((a2-14 (shl (the-as int a2-13) 16))) - (nop!) - (b! (nonzero? a2-14) cfg-27 :delay (nop!)) - ) - (b! (= a1-13 v1-36) cfg-27 :delay (nop!)) - ) - ) - (add-fg-prim-using-y-probe a0-17 obj) - ) + (let ((a2-14 (shl (the-as int a2-13) 16))) (nop!) (b! (nonzero? a2-14) cfg-27 :delay (nop!))) + (b! (= a1-13 v1-36) cfg-27 :delay (nop!)))) + (add-fg-prim-using-y-probe a0-17 obj)) (label cfg-27) 0 (label cfg-28) (set! v1-34 s2-2) *collide-usually-hit-by-player-list* - (set! s2-2 (-> s2-2 next0)) - ) - ) - ) - ) - (let ((v1-43 (the-as uint128 (make-u128 0 8)))) - (.pand v1-44 v1-43 s5-0) - ) + (set! s2-2 (-> s2-2 next0)))))) + (let ((v1-43 (the-as uint128 (make-u128 0 8)))) (.pand v1-44 v1-43 s5-0)) (when (nonzero? (the-as int v1-44)) (let ((v1-46 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((s2-3 (-> v1-46 next0))) (while (!= v1-46 (-> *collide-hit-by-others-list* alive-list-end)) (let* ((v1-47 (the-as collide-shape (-> (the-as connection v1-46) param1))) - (a0-24 (-> v1-47 root-prim)) - ) - (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) - (.pand a1-16 s5-0 a1-15) - ) + (a0-24 (-> v1-47 root-prim))) + (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) (.pand a1-16 s5-0 a1-15)) (b! (zero? (the-as int a1-16)) cfg-38) (nop!) (nop!) @@ -1600,35 +1253,20 @@ (.pcgtw a3-7 s4-0 a3-6) (.por a2-17 a2-16 a3-7) (.ppach a2-18 zero a2-17) - (let ((a2-19 (shl (the-as int a2-18) 16))) - (nop!) - (b! (nonzero? a2-19) cfg-37 :delay (nop!)) - ) - (b! (= a1-18 v1-48) cfg-37 :delay (nop!)) - ) - ) - (add-fg-prim-using-y-probe a0-24 obj) - ) + (let ((a2-19 (shl (the-as int a2-18) 16))) (nop!) (b! (nonzero? a2-19) cfg-37 :delay (nop!))) + (b! (= a1-18 v1-48) cfg-37 :delay (nop!)))) + (add-fg-prim-using-y-probe a0-24 obj)) (label cfg-37) 0 (label cfg-38) (set! v1-46 s2-3) *collide-hit-by-others-list* - (set! s2-3 (-> s2-3 next0)) - ) - ) - ) - ) - ) - ) - (none) - ) - ) + (set! s2-3 (-> s2-3 next0)))))))) + (none))) (defmethod add-fg-prim-using-y-probe ((obj collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-y-probe!~%") - (none) - ) + (none)) (defmethod add-fg-prim-using-y-probe ((obj collide-shape-prim-sphere) (arg0 collide-cache)) (local-vars (t1-1 uint)) @@ -1638,8 +1276,7 @@ (t1-0 100) (v1-0 (-> obj prim-core world-sphere quad)) (t2-0 (* a3-0 2)) - (a2-0 (-> obj prim-core quad 1)) - ) + (a2-0 (-> obj prim-core quad 1))) (b! (= a3-0 t1-0) cfg-2 :delay (set! t1-1 (+ t2-0 a3-0))) (let ((t0-1 (the-as object (&-> t0-0 0 prim-core quad t1-1)))) (let ((a3-1 (+ a3-0 1))) @@ -1651,19 +1288,14 @@ (nop!) (set! (-> (the-as collide-cache-prim t0-1) prim-core quad 1) a2-0) (nop!) - (set! (-> arg0 num-prims) (the-as int a3-1)) - ) + (set! (-> arg0 num-prims) (the-as int a3-1))) (nop!) - (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0) - ) - ) + (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") (label cfg-3) - (none) - ) - + (none)) (defmethod add-fg-prim-using-y-probe ((obj collide-shape-prim-group) (arg0 collide-cache)) (local-vars @@ -1678,18 +1310,15 @@ (a0-1 collide-shape-prim) (a1-1 uint128) (a1-2 uint128) - (f31-0 none) - ) + (f31-0 none)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (nop!) (let ((s5-0 (-> obj prims)) - (s4-0 (-> obj num-prims-u)) - ) + (s4-0 (-> obj num-prims-u))) (nop!) (let ((s3-0 (-> arg0 collide-box4w min quad))) (nop!) @@ -1709,12 +1338,7 @@ (set! s5-0 (&-> s5-0 1)) (.add.w.vf vf3 vf1 vf1) (set! s1-0 (-> s5-0 0)) - (let ((v1-1 (logand s0-0 v1-0))) - (nop!) - (b! (zero? v1-1) cfg-1 :delay (nop!)) - ) - ) - ) + (let ((v1-1 (logand s0-0 v1-0))) (nop!) (b! (zero? v1-1) cfg-1 :delay (nop!))))) (.ftoi.vf vf4 vf2) (nop!) (.ftoi.vf vf5 vf3) @@ -1731,23 +1355,12 @@ (.mov r0-2 f31-0) (.ppach v1-5 r0-2 v1-4) (.mov r0-3 f31-0) - (let ((v1-6 (shl (the-as int v1-5) 16))) - (nop!) - (b! (nonzero? v1-6) cfg-1 :delay (nop!)) - ) + (let ((v1-6 (shl (the-as int v1-5) 16))) (nop!) (b! (nonzero? v1-6) cfg-1 :delay (nop!))) (add-fg-prim-using-y-probe a0-1 arg0) - (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)) - ) - ) - ) - ) + (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)))))) (label cfg-5) 0 - (none) - ) - ) - - + (none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; foreground Line Sphere @@ -1758,29 +1371,23 @@ ((reg-vf28 vector :inline) (reg-vf29 vector :inline) (reg-vf30 vector :inline) - (reg-vf31 vector :inline) - ) - ) + (reg-vf31 vector :inline))) (define *pc-fffuls-work* (new 'global 'pc-fffuls-work)) (defmacro save-fffuls-work () `(begin - (.svf (&-> *pc-fffuls-work* reg-vf31 quad) vf31) - (.svf (&-> *pc-fffuls-work* reg-vf30 quad) vf30) - (.svf (&-> *pc-fffuls-work* reg-vf29 quad) vf29) - (.svf (&-> *pc-fffuls-work* reg-vf28 quad) vf28) - ) - ) + (.svf (&-> *pc-fffuls-work* reg-vf31 quad) vf31) + (.svf (&-> *pc-fffuls-work* reg-vf30 quad) vf30) + (.svf (&-> *pc-fffuls-work* reg-vf29 quad) vf29) + (.svf (&-> *pc-fffuls-work* reg-vf28 quad) vf28))) (defmacro load-fffuls-work () `(begin - (.lvf vf28 (&-> *pc-fffuls-work* reg-vf28 quad)) - (.lvf vf29 (&-> *pc-fffuls-work* reg-vf29 quad)) - (.lvf vf30 (&-> *pc-fffuls-work* reg-vf30 quad)) - (.lvf vf31 (&-> *pc-fffuls-work* reg-vf31 quad)) - ) - ) + (.lvf vf28 (&-> *pc-fffuls-work* reg-vf28 quad)) + (.lvf vf29 (&-> *pc-fffuls-work* reg-vf29 quad)) + (.lvf vf30 (&-> *pc-fffuls-work* reg-vf30 quad)) + (.lvf vf31 (&-> *pc-fffuls-work* reg-vf31 quad)))) (defmethod fill-from-foreground-using-line-sphere ((obj collide-cache)) (local-vars @@ -1819,8 +1426,7 @@ (a3-5 uint128) (a3-6 uint128) (a3-7 uint128) - (f31-0 none) - ) + (f31-0 none)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -1832,35 +1438,28 @@ (vf31 :class vf) (vf4 :class vf) (vf5 :class vf) - (vf6 :class vf) - ) + (vf6 :class vf)) (init-vf0-vector) (set! zero (the uint128 0)) (let* ((v1-0 *collide-work*) (s5-0 (-> v1-0 collide-box4w min quad)) (s4-0 (-> v1-0 collide-box4w max quad)) - (s3-0 (the-as uint128 (-> obj collide-with))) - ) + (s3-0 (the-as uint128 (-> obj collide-with)))) (.lvf vf28 (&-> v1-0 inv-mat vector 0 quad)) (.lvf vf29 (&-> v1-0 inv-mat vector 1 quad)) (.lvf vf30 (&-> v1-0 inv-mat vector 2 quad)) (.lvf vf31 (&-> v1-0 inv-mat vector 3 quad)) (save-fffuls-work) (.mov v1-1 vf31) - (let ((v1-3 (the-as uint128 (make-u128 0 16)))) - (.pand v1-4 v1-3 s3-0) - ) + (let ((v1-3 (the-as uint128 (make-u128 0 16)))) (.pand v1-4 v1-3 s3-0)) (when (nonzero? (the-as int v1-4)) (let ((v1-7 (-> *collide-player-list* alive-list next0))) *collide-player-list* (let ((s2-0 (-> v1-7 next0))) (while (!= v1-7 (-> *collide-player-list* alive-list-end)) (let* ((v1-8 (the-as collide-shape (-> (the-as connection v1-7) param1))) - (a0-3 (-> v1-8 root-prim)) - ) - (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) - (.pand a1-1 s3-0 a1-0) - ) + (a0-3 (-> v1-8 root-prim))) + (let ((a1-0 (the-as uint128 (-> a0-3 prim-core collide-as)))) (.pand a1-1 s3-0 a1-0)) (b! (zero? (the-as int a1-1)) cfg-7) (.mul.w.vf acc vf31 vf0) (.lvf vf1 (&-> a0-3 prim-core world-sphere quad)) @@ -1886,43 +1485,26 @@ (.pcgtw a3-1 s5-0 a3-0) (.por a2-2 a2-1 a3-1) (.ppach a2-3 zero a2-2) - (let ((a2-4 (shl (the-as int a2-3) 16))) - (nop!) - (b! (nonzero? a2-4) cfg-6 :delay (nop!)) - ) - (b! (= a1-3 v1-9) cfg-6 :delay (nop!)) - ) - ) - (add-fg-prim-using-line-sphere a0-3 obj) - ) + (let ((a2-4 (shl (the-as int a2-3) 16))) (nop!) (b! (nonzero? a2-4) cfg-6 :delay (nop!))) + (b! (= a1-3 v1-9) cfg-6 :delay (nop!)))) + (add-fg-prim-using-line-sphere a0-3 obj)) (label cfg-6) 0 (label cfg-7) (set! v1-7 s2-0) *collide-player-list* - (set! s2-0 (-> s2-0 next0)) - ) - ) - ) - ) - (let ((v1-16 (the-as uint128 (make-u128 0 14)))) - (.pand v1-17 v1-16 s3-0) - ) + (set! s2-0 (-> s2-0 next0)))))) + (let ((v1-16 (the-as uint128 (make-u128 0 14)))) (.pand v1-17 v1-16 s3-0)) (when (nonzero? (the-as int v1-17)) - (let ((v1-19 (the-as uint128 (make-u128 0 2)))) - (.pand v1-20 v1-19 s3-0) - ) + (let ((v1-19 (the-as uint128 (make-u128 0 2)))) (.pand v1-20 v1-19 s3-0)) (when (nonzero? (the-as int v1-20)) (let ((v1-23 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* (let ((s2-1 (-> v1-23 next0))) (while (!= v1-23 (-> *collide-hit-by-player-list* alive-list-end)) (let* ((v1-24 (the-as collide-shape (-> (the-as connection v1-23) param1))) - (a0-10 (-> v1-24 root-prim)) - ) - (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) - (.pand a1-6 s3-0 a1-5) - ) + (a0-10 (-> v1-24 root-prim))) + (let ((a1-5 (the-as uint128 (-> a0-10 prim-core collide-as)))) (.pand a1-6 s3-0 a1-5)) (b! (zero? (the-as int a1-6)) cfg-18) (.mul.w.vf acc vf31 vf0) (.lvf vf1 (&-> a0-10 prim-core world-sphere quad)) @@ -1948,39 +1530,24 @@ (.pcgtw a3-3 s5-0 a3-2) (.por a2-7 a2-6 a3-3) (.ppach a2-8 zero a2-7) - (let ((a2-9 (shl (the-as int a2-8) 16))) - (nop!) - (b! (nonzero? a2-9) cfg-17 :delay (nop!)) - ) - (b! (= a1-8 v1-25) cfg-17 :delay (nop!)) - ) - ) - (add-fg-prim-using-line-sphere a0-10 obj) - ) + (let ((a2-9 (shl (the-as int a2-8) 16))) (nop!) (b! (nonzero? a2-9) cfg-17 :delay (nop!))) + (b! (= a1-8 v1-25) cfg-17 :delay (nop!)))) + (add-fg-prim-using-line-sphere a0-10 obj)) (label cfg-17) 0 (label cfg-18) (set! v1-23 s2-1) *collide-hit-by-player-list* - (set! s2-1 (-> s2-1 next0)) - ) - ) - ) - ) - (let ((v1-32 (the-as uint128 (make-u128 0 4)))) - (.pand v1-33 v1-32 s3-0) - ) + (set! s2-1 (-> s2-1 next0)))))) + (let ((v1-32 (the-as uint128 (make-u128 0 4)))) (.pand v1-33 v1-32 s3-0)) (when (nonzero? (the-as int v1-33)) (let ((v1-36 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((s2-2 (-> v1-36 next0))) (while (!= v1-36 (-> *collide-usually-hit-by-player-list* alive-list-end)) (let* ((v1-37 (the-as collide-shape (-> (the-as connection v1-36) param1))) - (a0-17 (-> v1-37 root-prim)) - ) - (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) - (.pand a1-11 s3-0 a1-10) - ) + (a0-17 (-> v1-37 root-prim))) + (let ((a1-10 (the-as uint128 (-> a0-17 prim-core collide-as)))) (.pand a1-11 s3-0 a1-10)) (b! (zero? (the-as int a1-11)) cfg-28) (nop!) (.mul.w.vf acc vf31 vf0) @@ -2007,39 +1574,24 @@ (.pcgtw a3-5 s5-0 a3-4) (.por a2-12 a2-11 a3-5) (.ppach a2-13 zero a2-12) - (let ((a2-14 (shl (the-as int a2-13) 16))) - (nop!) - (b! (nonzero? a2-14) cfg-27 :delay (nop!)) - ) - (b! (= a1-13 (the-as process-drawable v1-38)) cfg-27 :delay (nop!)) - ) - ) - (add-fg-prim-using-line-sphere a0-17 obj) - ) + (let ((a2-14 (shl (the-as int a2-13) 16))) (nop!) (b! (nonzero? a2-14) cfg-27 :delay (nop!))) + (b! (= a1-13 (the-as process-drawable v1-38)) cfg-27 :delay (nop!)))) + (add-fg-prim-using-line-sphere a0-17 obj)) (label cfg-27) 0 (label cfg-28) (set! v1-36 s2-2) *collide-usually-hit-by-player-list* - (set! s2-2 (-> s2-2 next0)) - ) - ) - ) - ) - (let ((v1-45 (the-as uint128 (make-u128 0 8)))) - (.pand v1-46 v1-45 s3-0) - ) + (set! s2-2 (-> s2-2 next0)))))) + (let ((v1-45 (the-as uint128 (make-u128 0 8)))) (.pand v1-46 v1-45 s3-0)) (when (nonzero? (the-as int v1-46)) (let ((v1-48 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((s2-3 (-> v1-48 next0))) (while (!= v1-48 (-> *collide-hit-by-others-list* alive-list-end)) (let* ((v1-49 (the-as collide-shape (-> (the-as connection v1-48) param1))) - (a0-24 (-> v1-49 root-prim)) - ) - (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) - (.pand a1-16 s3-0 a1-15) - ) + (a0-24 (-> v1-49 root-prim))) + (let ((a1-15 (the-as uint128 (-> a0-24 prim-core collide-as)))) (.pand a1-16 s3-0 a1-15)) (b! (zero? (the-as int a1-16)) cfg-38) (nop!) (.mul.w.vf acc vf31 vf0) @@ -2066,38 +1618,20 @@ (.pcgtw a3-7 s5-0 a3-6) (.por a2-17 a2-16 a3-7) (.ppach a2-18 zero a2-17) - (let ((a2-19 (shl (the-as int a2-18) 16))) - (nop!) - (b! (nonzero? a2-19) cfg-37 :delay (nop!)) - ) - (b! (= a1-18 v1-50) cfg-37 :delay (nop!)) - ) - ) - (add-fg-prim-using-line-sphere a0-24 obj) - ) + (let ((a2-19 (shl (the-as int a2-18) 16))) (nop!) (b! (nonzero? a2-19) cfg-37 :delay (nop!))) + (b! (= a1-18 v1-50) cfg-37 :delay (nop!)))) + (add-fg-prim-using-line-sphere a0-24 obj)) (label cfg-37) 0 (label cfg-38) (set! v1-48 s2-3) *collide-hit-by-others-list* - (set! s2-3 (-> s2-3 next0)) - ) - ) - ) - ) - ) - ) - (none) - ) - ) + (set! s2-3 (-> s2-3 next0)))))))) + (none))) (defmethod add-fg-prim-using-line-sphere ((obj collide-shape-prim) (arg0 collide-cache)) - (format - 0 - "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" - ) - (none) - ) + (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%") + (none)) (defmethod add-fg-prim-using-line-sphere ((obj collide-shape-prim-sphere) (arg0 collide-cache)) (local-vars (t1-1 uint)) @@ -2107,8 +1641,7 @@ (t1-0 100) (v1-0 (-> obj prim-core world-sphere quad)) (t2-0 (* a3-0 2)) - (a2-0 (-> obj prim-core quad 1)) - ) + (a2-0 (-> obj prim-core quad 1))) (b! (= a3-0 t1-0) cfg-2 :delay (set! t1-1 (+ t2-0 a3-0))) (let ((t0-1 (the-as object (&-> t0-0 0 prim-core quad t1-1)))) (let ((a3-1 (+ a3-0 1))) @@ -2120,18 +1653,14 @@ (nop!) (set! (-> (the-as collide-cache-prim t0-1) prim-core quad 1) a2-0) (nop!) - (set! (-> arg0 num-prims) (the-as int a3-1)) - ) + (set! (-> arg0 num-prims) (the-as int a3-1))) (nop!) - (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0) - ) - ) + (set! (-> (the-as collide-cache-prim t0-1) ccache) arg0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") (label cfg-3) - (none) - ) + (none)) (defmethod add-fg-prim-using-line-sphere ((obj collide-shape-prim-group) (arg0 collide-cache)) (local-vars @@ -2142,8 +1671,7 @@ (v1-6 uint128) (a0-1 collide-shape-prim) (a1-1 uint128) - (a1-2 uint128) - ) + (a1-2 uint128)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -2155,15 +1683,13 @@ (vf30 :class vf) (vf31 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (init-vf0-vector) (load-fffuls-work) (set! zero (the-as uint128 0)) (let ((v1-0 *collide-work*) (s5-0 (-> obj prims)) - (s4-0 (-> obj num-prims-u)) - ) + (s4-0 (-> obj num-prims-u))) (nop!) (let ((s3-0 (-> v1-0 collide-box4w min quad))) (nop!) @@ -2185,10 +1711,7 @@ (set! s1-0 (-> s5-0 0)) (let ((v1-2 (logand s0-0 v1-1))) (.add.mul.y.vf acc vf29 vf1 acc) - (b! (zero? v1-2) cfg-1 :delay (.add.mul.z.vf vf10 vf30 vf1 acc)) - ) - ) - ) + (b! (zero? v1-2) cfg-1 :delay (.add.mul.z.vf vf10 vf30 vf1 acc))))) (.sub.w.vf vf2 vf10 vf1 :mask #b111) (nop!) (.add.w.vf vf3 vf10 vf1 :mask #b111) @@ -2205,44 +1728,25 @@ (.pcgtw v1-4 s3-0 v1-3) (.por v1-5 a1-2 v1-4) (.ppach v1-6 zero v1-5) - (let ((v1-7 (shl (the-as int v1-6) 16))) - (nop!) - (b! (nonzero? v1-7) cfg-1 :delay (nop!)) - ) + (let ((v1-7 (shl (the-as int v1-6) 16))) (nop!) (b! (nonzero? v1-7) cfg-1 :delay (nop!))) (add-fg-prim-using-line-sphere a0-1 arg0) - (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)) - ) - ) - ) - ) + (b! (nonzero? s4-0) cfg-2 :delay (set! a0-1 s1-0)))))) (label cfg-5) 0 - (none) - ) - ) + (none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; PROBE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defmethod fill-and-probe-using-y-probe ((obj collide-cache) - (arg0 vector) - (arg1 float) - (arg2 collide-kind) - (arg3 process-drawable) - (arg4 collide-tri-result) - (arg5 pat-surface) - ) +(defmethod fill-and-probe-using-y-probe ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 process-drawable) (arg4 collide-tri-result) (arg5 pat-surface)) (fill-using-y-probe obj arg0 arg1 arg2 arg3 arg5) - (probe-using-y-probe obj arg0 arg1 arg2 arg4 arg5) - ) + (probe-using-y-probe obj arg0 arg1 arg2 arg4 arg5)) (defmethod probe-using-y-probe ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 collide-tri-result) (arg4 pat-surface)) (rlet ((vf0 :class vf) (vf1 :class vf) - (vf3 :class vf) - ) + (vf3 :class vf)) (init-vf0-vector) (let ((gp-0 (new 'stack-no-clear 'collide-puyp-work))) (.mov vf3 arg1) @@ -2257,42 +1761,20 @@ (let ((s2-0 (the-as object (-> obj prims)))) (countdown (s1-0 (-> obj num-prims)) (when (and (logtest? arg2 (-> (the-as collide-cache-prim s2-0) prim-core collide-as)) - (logtest? (-> (the-as collide-cache-prim s2-0) prim-core action) (collide-action solid)) - ) + (logtest? (-> (the-as collide-cache-prim s2-0) prim-core action) (collide-action solid))) (cond - ((>= (-> (the-as collide-cache-prim s2-0) prim-core prim-type) 0) - (puyp-mesh obj gp-0 (the-as collide-cache-prim s2-0)) - ) + ((>= (-> (the-as collide-cache-prim s2-0) prim-core prim-type) 0) (puyp-mesh obj gp-0 (the-as collide-cache-prim s2-0))) (else - (if (zero? (logand arg4 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat))) - (puyp-sphere obj gp-0 (the-as collide-cache-prim s2-0)) - ) - ) - ) - ) - (set! s2-0 (-> (the-as (inline-array collide-cache-prim) s2-0) 1)) - ) - ) - (let ((f0-1 (-> gp-0 best-u))) - (if (< 1.0 f0-1) - (set! f0-1 -100000000.0) - ) - f0-1 - ) - ) - ) - ) - + (if (zero? (logand arg4 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat))) + (puyp-sphere obj gp-0 (the-as collide-cache-prim s2-0)))))) + (set! s2-0 (-> (the-as (inline-array collide-cache-prim) s2-0) 1)))) + (let ((f0-1 (-> gp-0 best-u))) (if (< 1.0 f0-1) (set! f0-1 -100000000.0)) f0-1)))) (defmethod puyp-sphere ((obj collide-cache) (arg0 collide-puyp-work) (arg1 collide-cache-prim)) - (let ((f0-1 (ray-sphere-intersect - (-> arg0 start-pos) - (-> arg0 move-dist) - (the-as vector (-> arg1 prim-core)) - (-> arg1 prim-core world-sphere w) - ) - ) - ) + (let ((f0-1 (ray-sphere-intersect (-> arg0 start-pos) + (-> arg0 move-dist) + (the-as vector (-> arg1 prim-core)) + (-> arg1 prim-core world-sphere w)))) (when (and (>= f0-1 0.0) (< f0-1 (-> arg0 best-u))) (set! (-> arg0 best-u) f0-1) (let ((gp-0 (-> arg0 tri-out))) @@ -2302,142 +1784,74 @@ (vector-normalize! (-> gp-0 normal) 1.0) (set! (-> gp-0 vertex 0 quad) (-> gp-0 intersect quad)) (point-in-plane-<-point+normal! (-> gp-0 vertex 1) (-> gp-0 intersect) (-> gp-0 normal)) - (let* ((a0-11 (vector-normalize! - (vector-! (new 'stack-no-clear 'vector) (-> gp-0 vertex 1) (the-as vector (-> gp-0 vertex))) - 1.0 - ) - ) - (a2-5 (vector-cross! (new 'stack-no-clear 'vector) (-> gp-0 normal) a0-11)) - ) - (vector+*! (-> gp-0 vertex 2) (-> gp-0 intersect) a2-5 4096.0) - ) - ) - ) - ) - ) + (let* ((a0-11 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 vertex 1) (the-as vector (-> gp-0 vertex))) 1.0)) + (a2-5 (vector-cross! (new 'stack-no-clear 'vector) (-> gp-0 normal) a0-11))) + (vector+*! (-> gp-0 vertex 2) (-> gp-0 intersect) a2-5 4096.0)))))) -(defmethod fill-and-probe-using-line-sphere ((obj collide-cache) - (arg0 vector) - (arg1 vector) - (arg2 float) - (arg3 collide-kind) - (arg4 process) - (arg5 collide-tri-result) - (arg6 pat-surface) - ) +(defmethod fill-and-probe-using-line-sphere ((obj collide-cache) (arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process) (arg5 collide-tri-result) (arg6 pat-surface)) (fill-using-line-sphere obj arg0 arg1 arg2 arg3 (the-as process-drawable arg4) arg6) - (probe-using-line-sphere obj arg0 arg1 arg2 arg3 arg5 arg6) - ) + (probe-using-line-sphere obj arg0 arg1 arg2 arg3 arg5 arg6)) (deftype collide-puls-work (structure) - ((ignore-pat pat-surface :offset-assert 0) - (tri-out collide-tri-result :offset-assert 4) - (bsphere sphere :inline :offset-assert 16) - (move-dist vector :inline :offset-assert 32) - ) + ((ignore-pat pat-surface :offset-assert 0) + (tri-out collide-tri-result :offset-assert 4) + (bsphere sphere :inline :offset-assert 16) + (move-dist vector :inline :offset-assert 32)) :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 - ) + :size-assert #x30 + :flag-assert #x900000030) - -(defmethod probe-using-line-sphere ((obj collide-cache) - (arg0 vector) - (arg1 vector) - (arg2 float) - (arg3 collide-kind) - (arg4 collide-tri-result) - (arg5 pat-surface) - ) +(defmethod probe-using-line-sphere ((obj collide-cache) (arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 collide-tri-result) (arg5 pat-surface)) (rlet ((vf0 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) - (init-vf0-vector) - (let ((s4-0 (new 'stack-no-clear 'collide-puls-work))) - (.mov vf4 arg2) - (.lvf vf3 (&-> arg0 quad)) - (.lvf vf2 (&-> arg1 quad)) - (set! (-> s4-0 ignore-pat) arg5) - (.mul.x.vf vf3 vf0 vf4 :mask #b1000) - (set! (-> s4-0 tri-out) arg4) - (.svf (&-> s4-0 move-dist quad) vf2) - (.svf (&-> s4-0 bsphere quad) vf3) - (let ((s3-0 (the-as object (-> obj prims))) - (f30-0 -100000000.0) - ) - (countdown (s2-0 (-> obj num-prims)) - (when (and (logtest? arg3 (-> (the-as collide-cache-prim s3-0) prim-core collide-as)) - (logtest? (-> (the-as collide-cache-prim s3-0) prim-core action) (collide-action solid)) - ) - (cond - ((>= (-> (the-as collide-cache-prim s3-0) prim-core prim-type) 0) - (let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri) - (the-as collide-cache-prim s3-0) - (-> s4-0 tri-out) - (the-as collide-prim-core (-> s4-0 bsphere)) - (-> s4-0 move-dist) - f30-0 - (collide-action solid) - ) - ) - ) - (if (>= f0-0 0.0) - (set! f30-0 f0-0) - ) - ) - ) - (else - (when (zero? (logand arg5 - (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s3-0) prim)) pat) - ) - ) - (let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere) - (the-as collide-cache-prim s3-0) - (-> s4-0 tri-out) - (the-as collide-prim-core (-> s4-0 bsphere)) - (-> s4-0 move-dist) - f30-0 - (collide-action solid) - ) - ) - ) - (if (>= f0-1 0.0) - (set! f30-0 f0-1) - ) - ) - ) - ) - ) - ) - (set! s3-0 (-> (the-as (inline-array collide-cache-prim) s3-0) 1)) - ) - f30-0 - ) - ) - ) - ) + (vf4 :class vf)) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'collide-puls-work))) + (.mov vf4 arg2) + (.lvf vf3 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (set! (-> s4-0 ignore-pat) arg5) + (.mul.x.vf vf3 vf0 vf4 :mask #b1000) + (set! (-> s4-0 tri-out) arg4) + (.svf (&-> s4-0 move-dist quad) vf2) + (.svf (&-> s4-0 bsphere quad) vf3) + (let ((s3-0 (the-as object (-> obj prims))) + (f30-0 -100000000.0)) + (countdown (s2-0 (-> obj num-prims)) + (when (and (logtest? arg3 (-> (the-as collide-cache-prim s3-0) prim-core collide-as)) + (logtest? (-> (the-as collide-cache-prim s3-0) prim-core action) (collide-action solid))) + (cond + ((>= (-> (the-as collide-cache-prim s3-0) prim-core prim-type) 0) + (let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri) (the-as collide-cache-prim s3-0) + (-> s4-0 tri-out) + (the-as collide-prim-core (-> s4-0 bsphere)) + (-> s4-0 move-dist) + f30-0 + (collide-action solid)))) + (if (>= f0-0 0.0) (set! f30-0 f0-0)))) + (else + (when (zero? (logand arg5 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s3-0) prim)) pat))) + (let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere) (the-as collide-cache-prim s3-0) + (-> s4-0 tri-out) + (the-as collide-prim-core (-> s4-0 bsphere)) + (-> s4-0 move-dist) + f30-0 + (collide-action solid)))) + (if (>= f0-1 0.0) (set! f30-0 f0-1))))))) + (set! s3-0 (-> (the-as (inline-array collide-cache-prim) s3-0) 1))) + f30-0)))) (defmethod fill-and-probe-using-spheres ((obj collide-cache) (arg0 collide-using-spheres-params)) (fill-using-spheres obj arg0) - (probe-using-spheres obj arg0) - ) + (probe-using-spheres obj arg0)) (defmethod fill-using-spheres ((obj collide-cache) (arg0 collide-using-spheres-params)) (let ((s4-0 (new 'stack-no-clear 'bounding-box))) (set-from-spheres! s4-0 (-> arg0 spheres) (the-as int (-> arg0 num-spheres))) ;; this box looks correct - (fill-using-bounding-box - obj - s4-0 - (-> arg0 collide-with) - (-> arg0 proc) - (the-as pat-surface (-> arg0 ignore-pat)) - ) - ) - (none) - ) + (fill-using-bounding-box obj s4-0 (-> arg0 collide-with) (-> arg0 proc) (the-as pat-surface (-> arg0 ignore-pat)))) + (none)) (defmethod probe-using-spheres ((obj collide-cache) (arg0 collide-using-spheres-params)) (local-vars (v1-12 symbol)) @@ -2445,23 +1859,16 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (let ((s5-0 (scratchpad-object collide-puss-work)) (a3-0 64) - (a2-0 (-> arg0 num-spheres)) - ) + (a2-0 (-> arg0 num-spheres))) (let ((v1-0 (-> s5-0 spheres)) - (a1-1 (-> arg0 spheres)) - ) - (let ((a3-1 (- a2-0 (the-as uint a3-0)))) - (nop!) - (b! (> (the-as int a3-1) 0) cfg-20 :delay (nop!)) - ) + (a1-1 (-> arg0 spheres))) + (let ((a3-1 (- a2-0 (the-as uint a3-0)))) (nop!) (b! (> (the-as int a3-1) 0) cfg-20 :delay (nop!))) (b! (zero? a2-0) cfg-5 :delay (.lvf vf1 a1-1)) (let ((a2-1 (+ a2-0 -1)) - (a1-2 (the-as (inline-array sphere) (-> a1-1 1))) - ) + (a1-2 (the-as (inline-array sphere) (-> a1-1 1)))) (.sub.w.vf vf2 vf1 vf1 :mask #b111) (.svf (&-> v1-0 0 bsphere quad) vf1) (.add.w.vf vf3 vf1 vf1 :mask #b111) @@ -2494,10 +1901,7 @@ (.svf (&-> v1-1 bbox4w min quad) vf4) (nop!) (.svf (&-> v1-1 bbox4w max quad) vf5) - (b! #t cfg-3 :delay (set! v1-1 (&+ v1-1 48))) - ) - ) - ) + (b! #t cfg-3 :delay (set! v1-1 (&+ v1-1 48)))))) (label cfg-5) (.ftoi.vf vf2 vf2) (nop!) @@ -2509,36 +1913,27 @@ (.svf (&-> s5-0 spheres-bbox4w max quad) vf3) (let ((s4-0 (the-as collide-cache-prim (-> obj prims))) (s3-0 (-> arg0 collide-with)) - (s2-0 (-> obj num-prims)) - ) + (s2-0 (-> obj num-prims))) (b! #t cfg-18 :delay (nop!)) (label cfg-6) (+! s2-0 -1) (when (logtest? s3-0 (-> s4-0 prim-core collide-as)) (when (or (not (-> arg0 solid-only)) (logtest? (-> s4-0 prim-core action) (collide-action solid))) (if (>= (-> s4-0 prim-core prim-type) 0) - (set! v1-12 (collide-puss-work-method-9 s5-0 s4-0 arg0)) - (set! v1-12 (collide-puss-work-method-10 s5-0 s4-0 arg0)) - ) + (set! v1-12 (collide-puss-work-method-9 s5-0 s4-0 arg0)) + (set! v1-12 (collide-puss-work-method-10 s5-0 s4-0 arg0))) (when v1-12 ;; uncomment to view the point that blocks you from exiting duck. - ;;(add-debug-point #t (bucket-id debug-no-zbuf) (-> s5-0 closest-pt)) - (return #t) - ) - ) - ) + ;;(add-debug-point #t (bucket-id debug-no-zbuf) (-> s5-0 closest-pt)) + (return #t)))) (&+! s4-0 48) (label cfg-18) - (b! (nonzero? s2-0) cfg-6 :delay (nop!)) - ) + (b! (nonzero? s2-0) cfg-6 :delay (nop!))) (b! #t cfg-21 :delay (nop!)) (label cfg-20) ;; fixed bad format string - (format 0 "ERROR: Exceeded max # of spheres in collide-cache::probe-using-spheres!~%") - ) + (format 0 "ERROR: Exceeded max # of spheres in collide-cache::probe-using-spheres!~%")) (label cfg-21) - #f - ) - ) + #f)) -;; todo a bunch of suffering. \ No newline at end of file +;; todo a bunch of suffering. diff --git a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc index 641f5fd3c6..8deeeca200 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/math/vector-h.gc") (require "engine/geometry/bounding-box-h.gc") @@ -20,143 +19,138 @@ ;; DECOMP BEGINS (deftype edge-grab-info (structure) - ((world-vertex vector 6 :inline) - (local-vertex vector 6 :inline) - (actor-cshape-prim-offset int32) - (actor-handle handle) - (hanging-matrix matrix :inline) - (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) - (center-hold vector :inline :overlay-at (-> world-vertex 2)) - (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) - (left-hand-hold vector :inline) - (right-hand-hold vector :inline) - (center-hold-old vector :inline) - (edge-tri-pat uint32) - ) + ((world-vertex vector 6 :inline) + (local-vertex vector 6 :inline) + (actor-cshape-prim-offset int32) + (actor-handle handle) + (hanging-matrix matrix :inline) + (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) + (center-hold vector :inline :overlay-at (-> world-vertex 2)) + (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) + (left-hand-hold vector :inline) + (right-hand-hold vector :inline) + (center-hold-old vector :inline) + (edge-tri-pat uint32)) (:methods - (edge-grab-info-method-9 (_type_) symbol) - (debug-draw (_type_) symbol) - ) - ) + (edge-grab-info-method-9 (_type_) symbol) + (debug-draw (_type_) symbol))) ;; og:preserve-this (declare-type collide-cache-tri structure) -(deftype collide-edge-tri (structure) - ((ctri collide-cache-tri) - (normal vector :inline) - ) - ) +(deftype collide-edge-tri (structure) + ((ctri collide-cache-tri) + (normal vector :inline))) (deftype collide-edge-edge (structure) - ((ignore basic) - (etri collide-edge-tri) - (vertex-ptr (inline-array vector) 2) - (outward vector :inline) - (edge-vec-norm vector :inline) - ) - ) - + ((ignore basic) + (etri collide-edge-tri) + (vertex-ptr (inline-array vector) 2) + (outward vector :inline) + (edge-vec-norm vector :inline))) (deftype collide-edge-hold-item (structure) - ((next collide-edge-hold-item) - (rating float) - (split int8) - (edge collide-edge-edge) - (center-pt vector :inline) - (outward-pt vector :inline) - ) - ) - + ((next collide-edge-hold-item) + (rating float) + (split int8) + (edge collide-edge-edge) + (center-pt vector :inline) + (outward-pt vector :inline))) (deftype collide-edge-hold-list (structure) - ((num-allocs uint32) - (num-attempts uint32) - (head collide-edge-hold-item) - (items collide-edge-hold-item 32 :inline) - (attempts qword 32 :inline) - ) + ((num-allocs uint32) + (num-attempts uint32) + (head collide-edge-hold-item) + (items collide-edge-hold-item 32 :inline) + (attempts qword 32 :inline)) (:methods - (debug-draw (_type_) object) - (add-to-list! (_type_ collide-edge-hold-item) none) - ) - ) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none))) ;; og:preserve-this (declare-type collide-cache basic) + (declare-type collide-shape basic) + (deftype collide-edge-work (structure) - ((ccache collide-cache) - (cshape collide-shape) - (num-verts uint32) - (num-edges uint32) - (num-tris uint32) - (cache-fill-box bounding-box :inline) - (within-reach-box bounding-box :inline) - (within-reach-box4w bounding-box4w :inline) - (search-pt vector :inline) - (search-dir-vec vector :inline) - (max-dist-sqrd-to-outward-pt float) - (max-dir-cosa-delta float) - (split-dists float 2) - (outward-offset vector :inline) - (local-cache-fill-box bounding-box :inline) - (local-within-reach-box bounding-box :inline) - (local-player-spheres sphere 12 :inline) - (world-player-spheres sphere 12 :inline) - (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) - (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) - (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) - (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) - (verts vector 64 :inline) - (edges collide-edge-edge 96 :inline) - (tris collide-edge-tri 48 :inline) - (hold-list collide-edge-hold-list :inline) - ) + ((ccache collide-cache) + (cshape collide-shape) + (num-verts uint32) + (num-edges uint32) + (num-tris uint32) + (cache-fill-box bounding-box :inline) + (within-reach-box bounding-box :inline) + (within-reach-box4w bounding-box4w :inline) + (search-pt vector :inline) + (search-dir-vec vector :inline) + (max-dist-sqrd-to-outward-pt float) + (max-dir-cosa-delta float) + (split-dists float 2) + (outward-offset vector :inline) + (local-cache-fill-box bounding-box :inline) + (local-within-reach-box bounding-box :inline) + (local-player-spheres sphere 12 :inline) + (world-player-spheres sphere 12 :inline) + (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) + (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) + (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) + (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) + (verts vector 64 :inline) + (edges collide-edge-edge 96 :inline) + (tris collide-edge-tri 48 :inline) + (hold-list collide-edge-hold-list :inline)) (:methods - (search-for-edges (_type_ collide-edge-hold-list) symbol) - (debug-draw-edges (_type_) object) - (debug-draw-tris (_type_) none) - (debug-draw-sphere (_type_) symbol) - (compute-center-point! (_type_ collide-edge-edge vector) float) - (collide-edge-work-method-14 (_type_ vector vector int) float) - (find-grabbable-edges! (_type_) none) - (find-grabbable-tris! (_type_) none) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) - ) - ) + (search-for-edges (_type_ collide-edge-hold-list) symbol) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) symbol) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (collide-edge-work-method-14 (_type_ vector vector int) float) + (find-grabbable-edges! (_type_) none) + (find-grabbable-tris! (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol))) - -(define *collide-edge-work* (new 'static 'collide-edge-work - :max-dist-sqrd-to-outward-pt 37748736.0 - :max-dir-cosa-delta 0.6 - :split-dists (new 'static 'array float 2 1024.0 1433.6) - :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) - :local-cache-fill-box (new 'static 'bounding-box - :min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) - :max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0) - ) - :local-within-reach-box (new 'static 'bounding-box - :min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) - :max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0) - ) - :local-player-spheres (new 'static 'inline-array sphere 12 - (new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6) - (new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16) - (new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48) - (new 'static 'sphere :x 1966.08 :y -8601.6 :w 1556.48) - (new 'static 'sphere :x 1761.28 :y -11059.2 :w 1351.68) - (new 'static 'sphere :x 1679.36 :y -13312.0 :w 1269.76) - (new 'static 'sphere :x -737.28 :y 4096.0 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 6553.6 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 9420.8 :w 3072.0) - (new 'static 'sphere :x 1720.32 :y 3686.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 5734.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 8601.6 :w 2949.12) - ) - ) - ) +(define *collide-edge-work* + (new 'static + 'collide-edge-work + :max-dist-sqrd-to-outward-pt 37748736.0 + :max-dir-cosa-delta 0.6 + :split-dists + (new 'static 'array float 2 1024.0 1433.6) + :outward-offset + (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :local-cache-fill-box + (new 'static + 'bounding-box + :min + (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) + :max + (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0)) + :local-within-reach-box + (new 'static + 'bounding-box + :min + (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) + :max + (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0)) + :local-player-spheres + (new 'static + 'inline-array + sphere + 12 + (new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6) + (new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16) + (new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48) + (new 'static 'sphere :x 1966.08 :y -8601.6 :w 1556.48) + (new 'static 'sphere :x 1761.28 :y -11059.2 :w 1351.68) + (new 'static 'sphere :x 1679.36 :y -13312.0 :w 1269.76) + (new 'static 'sphere :x -737.28 :y 4096.0 :w 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :w 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :w 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :w 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :w 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :w 2949.12)))) (define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info)) diff --git a/goal_src/jak1/engine/collide/collide-edge-grab.gc b/goal_src/jak1/engine/collide/collide-edge-grab.gc index 0775449ef7..bcc7caf913 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/surface-h.gc") (require "engine/collide/collide-edge-grab-h.gc") (require "kernel/gstate.gc") @@ -25,21 +24,18 @@ (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) - (vf7 :class vf) - ) + (vf7 :class vf)) (let ((gp-0 *collide-edge-work*)) ;; reset the edge work... (set! (-> gp-0 num-verts) (the-as uint 0)) (set! (-> gp-0 num-edges) (the-as uint 0)) (set! (-> gp-0 num-tris) (the-as uint 0)) - (let ((v1-0 (-> this control))) (set! (-> gp-0 ccache) arg0) (.lvf vf1 (&-> gp-0 local-cache-fill-box min quad)) (.lvf vf2 (&-> gp-0 local-cache-fill-box max quad)) (set! (-> gp-0 cshape) v1-0) - (.lvf vf3 (&-> v1-0 trans quad)) - ) + (.lvf vf3 (&-> v1-0 trans quad))) ;; translate the cache filling box (.add.vf vf1 vf1 vf3 :mask #b111) (.add.vf vf2 vf2 vf3 :mask #b111) @@ -57,16 +53,12 @@ (.svf (&-> gp-0 within-reach-box max quad) vf5) (.svf (&-> gp-0 within-reach-box4w min quad) vf6) (.svf (&-> gp-0 within-reach-box4w max quad) vf7) - ;; Fill the collide cache! - (fill-using-bounding-box - arg0 - (-> gp-0 cache-fill-box) - (-> this control root-prim collide-with) - this - (new 'static 'pat-surface :noentity #x1) - ) - + (fill-using-bounding-box arg0 + (-> gp-0 cache-fill-box) + (-> this control root-prim collide-with) + this + (new 'static 'pat-surface :noentity #x1)) ;; Filter out tris that can't be grabbed (find-grabbable-tris! gp-0) (when (nonzero? (-> gp-0 num-tris)) @@ -82,22 +74,13 @@ (search-for-edges gp-0 (-> gp-0 hold-list)) (when (find-best-grab! gp-0 (-> gp-0 hold-list) *edge-grab-info*) (send-event *target* 'edge-grab) - (return (the-as object #f)) - ) - ) + (return (the-as object #f)))) ;; use target's heading (vector-z-quaternion! (-> gp-0 search-dir-vec) (-> *target* control unknown-quaternion00)) (search-for-edges gp-0 (-> gp-0 hold-list)) - (if (find-best-grab! gp-0 (-> gp-0 hold-list) *edge-grab-info*) - (send-event *target* 'edge-grab) - ) - 0 - ) - ) - ) - 0 - ) - ) + (if (find-best-grab! gp-0 (-> gp-0 hold-list) *edge-grab-info*) (send-event *target* 'edge-grab)) + 0))) + 0)) (defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) "Iterate through edges, adding them to the collide-edge-hold-list, if they are good" @@ -106,8 +89,7 @@ (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) - (s3-0 (the-as collide-edge-edge (-> this edges))) - ) + (s3-0 (the-as collide-edge-edge (-> this edges)))) ;; loop over edges (countdown (s2-0 (-> this num-edges)) (when (not (-> s3-0 ignore)) @@ -119,28 +101,19 @@ (+! (-> arg0 num-allocs) 1) (when (= (-> arg0 num-allocs) 32) (format 0 "ERROR: Reached limit of edge grab hold items!~%") - (return #f) - ) - (&+! s4-0 48) - ) - ) - (&+! s3-0 48) - ) - ) - #f - ) + (return #f)) + (&+! s4-0 48))) + (&+! s3-0 48))) + #f) ;; add to list. (defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list) (deftype pbhp-stack-vars (structure) - ((edge collide-edge-edge) - (allocated basic) - (neg-hold-pt vector :inline) - (split-vec vector :inline) - ) - ) - + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline))) (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) @@ -148,29 +121,19 @@ (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) (let* ((s3-0 (-> arg0 edge)) (s1-0 (-> s3-0 etri ctri)) - (s4-0 (-> s1-0 prim-index)) - ) + (s4-0 (-> s1-0 prim-index))) (let ((s0-0 (new 'stack-no-clear 'vector))) (vector+*! s0-0 (-> arg0 center-pt) (-> s3-0 edge-vec-norm) 1105.92) (let ((f0-0 (collide-edge-work-method-14 this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) - (if (< 491.52 f0-0) - (return #f) - ) - ) + (if (< 491.52 f0-0) (return #f))) (set! sv-144 vector+*!) (set! sv-160 s0-0) (set! sv-176 (-> arg0 center-pt)) (let ((a2-3 (vector-negate! (new 'stack-no-clear 'vector) (-> s3-0 edge-vec-norm))) - (a3-2 1105.92) - ) - (sv-144 sv-160 sv-176 a2-3 a3-2) - ) + (a3-2 1105.92)) + (sv-144 sv-160 sv-176 a2-3 a3-2)) (let ((f0-1 (collide-edge-work-method-14 this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) - (if (< 491.52 f0-1) - (return #f) - ) - ) - ) + (if (< 491.52 f0-1) (return #f)))) (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) @@ -179,23 +142,15 @@ (set! (-> arg1 world-vertex 0 quad) (-> s3-0 vertex-ptr 0 0 quad)) (set! (-> arg1 world-vertex 1 quad) (-> s3-0 vertex-ptr 1 0 quad)) (set! (-> arg1 hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) - (vector-normalize! - (vector-! (-> arg1 hanging-matrix vector 2) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) - 1.0 - ) - (vector-normalize! - (vector-cross! - (the-as vector (-> arg1 hanging-matrix)) - (-> arg1 hanging-matrix vector 2) - (-> arg1 hanging-matrix vector 1) - ) - 1.0 - ) - (vector-cross! - (-> arg1 hanging-matrix vector 2) - (the-as vector (-> arg1 hanging-matrix)) - (-> arg1 hanging-matrix vector 1) - ) + (vector-normalize! (vector-! (-> arg1 hanging-matrix vector 2) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) + 1.0) + (vector-normalize! (vector-cross! (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix vector 2) + (-> arg1 hanging-matrix vector 1)) + 1.0) + (vector-cross! (-> arg1 hanging-matrix vector 2) + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix vector 1)) (set! (-> arg1 hanging-matrix vector 3 quad) (-> arg1 center-hold quad)) (transform-vectors! (-> arg1 hanging-matrix) (-> this world-player-spheres) (-> this local-player-spheres) 12) (let ((a1-13 (new 'stack-no-clear 'collide-using-spheres-params))) @@ -205,37 +160,20 @@ (set! (-> a1-13 proc) #f) (set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-13 solid-only) #t) - (if (probe-using-spheres (-> this ccache) a1-13) - (return #f) - ) - ) + (if (probe-using-spheres (-> this ccache) a1-13) (return #f))) (let* ((v1-36 (the-as object (-> this ccache prims s4-0 prim))) - (a0-35 (-> (the-as collide-shape-prim v1-36) cshape)) - ) + (a0-35 (-> (the-as collide-shape-prim v1-36) cshape))) (cond (a0-35 - (set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-36) (the-as int (-> a0-35 process)))) - (set! (-> arg1 actor-handle) (process->handle (-> a0-35 process))) - (let ((a1-19 - (-> a0-35 process node-list data (-> (the-as collide-shape-prim v1-36) transform-index) bone transform) - ) - (s5-1 (new 'stack-no-clear 'matrix)) - ) - (matrix-4x4-inverse! s5-1 a1-19) - (dotimes (s4-1 6) - (vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1) - ) - ) - ) - (else - (set! (-> arg1 actor-cshape-prim-offset) 0) - (set! (-> arg1 actor-handle) (the-as handle #f)) - ) - ) - ) - ) - #t - ) + (set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-36) (the-as int (-> a0-35 process)))) + (set! (-> arg1 actor-handle) (process->handle (-> a0-35 process))) + (let ((a1-19 (-> a0-35 process node-list data (-> (the-as collide-shape-prim v1-36) transform-index) bone transform)) + (s5-1 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s5-1 a1-19) + (dotimes (s4-1 6) + (vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1)))) + (else (set! (-> arg1 actor-cshape-prim-offset) 0) (set! (-> arg1 actor-handle) (the-as handle #f)))))) + #t) (defmethod edge-grab-info-method-9 ((this edge-grab-info)) (local-vars (v0-0 symbol) (v1-14 int)) @@ -248,36 +186,19 @@ (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) - (vf7 :class vf) - ) + (vf7 :class vf)) (init-vf0-vector) (let ((s5-0 (the-as object #f))) (set! (-> this center-hold-old quad) (-> this center-hold quad)) (let ((v1-1 (-> this actor-cshape-prim-offset))) (when (nonzero? v1-1) (let ((a0-5 (handle->process (-> this actor-handle)))) - (if (not (the-as process a0-5)) - (return #f) - ) + (if (not (the-as process a0-5)) (return #f)) (set! s5-0 (+ (the-as int a0-5) v1-1)) - (if (zero? (-> (the-as collide-shape-prim s5-0) prim-core collide-as)) - (return #f) - ) - (let ((s4-0 - (-> (the-as process-drawable a0-5) - node-list - data - (-> (the-as collide-shape-prim s5-0) transform-index) - bone - transform - ) - ) - ) + (if (zero? (-> (the-as collide-shape-prim s5-0) prim-core collide-as)) (return #f)) + (let ((s4-0 (-> (the-as process-drawable a0-5) node-list data (-> (the-as collide-shape-prim s5-0) transform-index) bone transform))) (dotimes (s3-0 6) - (vector-matrix*! (-> this world-vertex s3-0) (-> this local-vertex s3-0) s4-0) - ) - ) - ) + (vector-matrix*! (-> this world-vertex s3-0) (-> this local-vertex s3-0) s4-0)))) (.lvf vf1 (&-> this world-vertex 3 quad)) (.lvf vf2 (&-> this world-vertex 4 quad)) (.lvf vf3 (&-> this world-vertex 5 quad)) @@ -295,46 +216,26 @@ (nop!) (.mul.vf vf6 vf6 Q :mask #b111) (.mov v1-14 vf6) - (b! (>= (the-as float (sar (the-as int v1-14) 32)) f1-0) cfg-17) - ) + (b! (>= (the-as float (sar (the-as int v1-14) 32)) f1-0) cfg-17)) (set! v0-0 #f) (b! #t cfg-27 :delay (nop!)) (label cfg-17) (set! (-> this hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) - (vector-normalize! - (vector-! (-> this hanging-matrix vector 2) (-> this world-vertex 1) (the-as vector (-> this world-vertex))) - 1.0 - ) - (vector-normalize! - (vector-cross! - (the-as vector (-> this hanging-matrix)) - (-> this hanging-matrix vector 2) - (-> this hanging-matrix vector 1) - ) - 1.0 - ) - (vector-cross! - (-> this hanging-matrix vector 2) - (the-as vector (-> this hanging-matrix)) - (-> this hanging-matrix vector 1) - ) + (vector-normalize! (vector-! (-> this hanging-matrix vector 2) (-> this world-vertex 1) (the-as vector (-> this world-vertex))) + 1.0) + (vector-normalize! (vector-cross! (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 2) + (-> this hanging-matrix vector 1)) + 1.0) + (vector-cross! (-> this hanging-matrix vector 2) + (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 1)) (set! (-> this hanging-matrix vector 3 quad) (-> this center-hold quad)) (let ((v1-21 *collide-edge-work*)) - (transform-vectors! - (-> this hanging-matrix) - (-> v1-21 world-player-spheres) - (-> v1-21 local-player-spheres) - 12 - ) - ) - ) - ) + (transform-vectors! (-> this hanging-matrix) (-> v1-21 world-player-spheres) (-> v1-21 local-player-spheres) 12)))) (let ((v1-22 *collide-edge-work*) - (a1-14 (new 'stack-no-clear 'collide-using-spheres-params)) - ) - (let ((a0-24 'target-edge-grab-jump)) - (b! (!= (-> *target* next-state name) a0-24) cfg-20 :delay (nop!)) - ) + (a1-14 (new 'stack-no-clear 'collide-using-spheres-params))) + (let ((a0-24 'target-edge-grab-jump)) (b! (!= (-> *target* next-state name) a0-24) cfg-20 :delay (nop!))) (set! (-> a1-14 spheres) (-> v1-22 world-player-leap-up-spheres)) (set! (-> a1-14 num-spheres) (the-as uint 6)) (set! (-> a1-14 collide-with) (-> v1-22 cshape root-prim collide-with)) @@ -350,26 +251,20 @@ (set! (-> a1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-14 solid-only) #t) (label cfg-21) - (b! (not (fill-and-probe-using-spheres *collide-cache* a1-14)) cfg-24) - ) + (b! (not (fill-and-probe-using-spheres *collide-cache* a1-14)) cfg-24)) (set! v0-0 #f) (b! #t cfg-27 :delay (nop!)) (the-as none 0) (label cfg-24) (b! (not (the-as int s5-0)) cfg-26) - (let ((v1-40 (-> (the-as collide-shape-prim s5-0) cshape))) - (send-event (-> v1-40 process) 'edge-grabbed this) - ) - ) + (let ((v1-40 (-> (the-as collide-shape-prim s5-0) cshape))) (send-event (-> v1-40 process) 'edge-grabbed this))) (label cfg-26) (set! v0-0 #t) (label cfg-27) - v0-0 - ) - ) - + v0-0)) (defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) + (defmethod-mips2c "(method 15 collide-edge-work)" 15 collide-edge-work) (defmethod collide-edge-work-method-14 ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) @@ -382,17 +277,8 @@ (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-3 vertex-ptr 0 0) (-> v1-3 vertex-ptr 1 0) s2-0))) (when (or (< f30-0 0.0) (< f0-0 f30-0)) (set! f30-0 f0-0) - (set! (-> arg0 quad) (-> s2-0 quad)) - ) - ) - ) - ) - ) - ) - ) - f30-0 - ) - ) + (set! (-> arg0 quad) (-> s2-0 quad))))))))) + f30-0)) ;; 17 cew (defmethod should-add-to-list? ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) @@ -405,8 +291,7 @@ (v1-6 float) (a3-1 uint128) (t0-0 uint128) - (t1-1 uint128) - ) + (t1-1 uint128)) (rlet ((Q :class vf) (vf0 :class vf) (vf1 :class vf) @@ -419,8 +304,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (nop!) (nop!) @@ -436,10 +320,7 @@ (.pcgtw t1-1 t0-0 t1-0) (.lvf vf4 (&-> this outward-offset quad)) (.pcgtw a3-1 a3-0 t0-0) - (.lvf vf5 (&-> v1-0 trans quad)) - ) - ) - ) + (.lvf vf5 (&-> v1-0 trans quad))))) (.por v1-1 t1-1 a3-1) (let ((f0-0 (-> this max-dist-sqrd-to-outward-pt))) (.ppach v1-2 r0-0 v1-1) @@ -464,9 +345,7 @@ (.mul.vf vf9 vf8 vf6) (.add.z.vf vf9 vf9 vf9 :mask #b1) (.mov v1-5 vf9) - (b! (< v1-5 f1-0) cfg-4) - ) - ) + (b! (< v1-5 f1-0) cfg-4))) (.sub.vf vf7 vf11 vf1) (.svf (&-> arg0 center-pt quad) vf1) (.mul.vf vf7 vf7 vf7) @@ -483,10 +362,7 @@ (b! #t cfg-6 :delay (nop!)) (set! v0-0 (the-as symbol 0)) (label cfg-6) - v0-0 - ) - ) - ) + v0-0))) (defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) @@ -502,18 +378,15 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (.mov.vf vf7 vf0) (.lvf vf1 (&-> this search-pt quad)) (let ((f0-0 0.0)) (let ((v1-0 (-> arg0 vertex-ptr 0)) - (a0-1 (-> arg0 vertex-ptr 1)) - ) + (a0-1 (-> arg0 vertex-ptr 1))) (.lvf vf2 (&-> v1-0 0 quad)) - (.lvf vf3 (&-> a0-1 0 quad)) - ) + (.lvf vf3 (&-> a0-1 0 quad))) (.sub.vf vf4 vf1 vf2) (.sub.vf vf5 vf3 vf2) (.mul.vf vf6 vf5 vf5) @@ -540,74 +413,41 @@ (b! (< f3-0 f0-0) cfg-4 :likely-delay (set! f3-0 f0-0)) (b! (< f1-0 f3-0) cfg-4 :likely-delay (set! f3-0 f1-0)) (label cfg-4) - (let ((v1-4 (* f3-0 f2-0))) - (.mov vf11 v1-4) - ) - ) - ) - ) - ) + (let ((v1-4 (* f3-0 f2-0))) (.mov vf11 v1-4)))))) (.mul.x.vf vf7 vf5 vf11 :mask #b111) (.add.vf vf7 vf7 vf2 :mask #b111) (.svf (&-> arg1 quad) vf7) (.mov v0-0 vf7) - v0-0 - ) - ) - + v0-0)) (defmethod debug-draw ((this edge-grab-info)) - (add-debug-line - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> this world-vertex)) - (-> this world-vertex 1) - (new 'static 'rgba :r #xff :a #x60) - #f - (the-as rgba -1) - ) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (-> this center-hold) - 204.8 - (new 'static 'rgba :r #xff :g #xff :a #x80) - ) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (-> this left-hand-hold) - 204.8 - (new 'static 'rgba :r #xff :g #xff :a #x60) - ) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (-> this right-hand-hold) - 204.8 - (new 'static 'rgba :r #xff :g #xff :a #x60) - ) - (add-debug-outline-triangle - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> this tri-vertex)) - (-> this world-vertex 4) - (-> this world-vertex 5) - (new 'static 'rgba :r #xff :a #x30) - ) - (the-as symbol (cond - ((nonzero? (-> this actor-cshape-prim-offset)) - (if (handle->process (-> this actor-handle)) - (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) - (format *stdcon* "grab: invalid handle~%") - ) - ) - (else - (format *stdcon* "grab: ground~%") - ) - ) - ) - ) + (add-debug-line #t + (bucket-id debug-no-zbuf) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) + (new 'static 'rgba :r #xff :a #x60) + #f + (the-as rgba -1)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> this center-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> this left-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60)) + (add-debug-sphere #t + (bucket-id debug-no-zbuf) + (-> this right-hand-hold) + 204.8 + (new 'static 'rgba :r #xff :g #xff :a #x60)) + (add-debug-outline-triangle #t + (bucket-id debug-no-zbuf) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) + (new 'static 'rgba :r #xff :a #x30)) + (the-as symbol + (cond + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) + (format *stdcon* "grab: invalid handle~%"))) + (else (format *stdcon* "grab: ground~%"))))) (defmethod debug-draw-edges ((this collide-edge-work)) (let ((gp-0 0)) @@ -615,65 +455,41 @@ (let* ((s3-0 (-> this edges s4-0)) (a2-0 (-> s3-0 vertex-ptr 0 0)) (a3-0 (-> s3-0 vertex-ptr 1 0)) - (s2-0 (new 'stack-no-clear 'vector)) - ) + (s2-0 (new 'stack-no-clear 'vector))) (vector+! s2-0 a2-0 a3-0) (vector-float*! s2-0 s2-0 0.5) (cond ((-> s3-0 ignore) - (add-debug-line - #t - (bucket-id debug-no-zbuf) - a2-0 - a3-0 - (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) - #f - (the-as rgba -1) - ) - (+! gp-0 1) - ) + (add-debug-line #t + (bucket-id debug-no-zbuf) + a2-0 + a3-0 + (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) + #f + (the-as rgba -1)) + (+! gp-0 1)) (else - (add-debug-line - #t - (bucket-id debug-no-zbuf) - a2-0 - a3-0 - (new 'static 'rgba :r #xff :g #xff :b #xff :a #x60) - #f - (the-as rgba -1) - ) - (add-debug-vector - #t - (bucket-id debug-no-zbuf) - s2-0 - (-> s3-0 outward) - (meters 0.3) - (new 'static 'rgba :r #xff :a #x80) - ) - ) - ) - ) - ) - (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) - ) - ) + (add-debug-line #t + (bucket-id debug-no-zbuf) + a2-0 + a3-0 + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x60) + #f + (the-as rgba -1)) + (add-debug-vector #t (bucket-id debug-no-zbuf) s2-0 (-> s3-0 outward) (meters 0.3) (new 'static 'rgba :r #xff :a #x80)))))) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0))) (defmethod debug-draw-sphere ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-verts))) (let ((a2-0 (-> this verts s5-0))) - (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) - ) - ) - #f - ) + (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)))) + #f) (defmethod debug-draw ((this collide-edge-hold-list)) (let ((s4-0 (-> this head)) - (s5-0 0) - ) + (s5-0 0)) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s2-0 #t) - ) + (s2-0 #t)) (set! (-> s3-0 quad) (-> *target* control unknown-vector90 quad)) (while s4-0 (+! s5-0 1) @@ -681,129 +497,86 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 409.6 (new 'static 'rgba :a #x80)) (cond (s2-0 - (set! s2-0 #f) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (-> s4-0 center-pt) - 614.4 - (new 'static 'rgba :r #xff :g #xff :a #x80) - ) - (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) - ) + (set! s2-0 #f) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80))) (else - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (-> s4-0 center-pt) - 614.4 - (new 'static 'rgba :r #x7f :g #x7f :a #x40) - ) - (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) - ) - ) - (set! s4-0 (-> s4-0 next)) - ) - ) - (format *stdcon* "hold list has ~D item(s)~%" s5-0) - ) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #x7f :g #x7f :a #x40)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)))) + (set! s4-0 (-> s4-0 next)))) + (format *stdcon* "hold list has ~D item(s)~%" s5-0)) (dotimes (s5-1 (the-as int (-> this num-attempts))) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> this attempts s5-1)) - 409.6 - (new 'static 'rgba :a #x40) - ) - ) - (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) - ) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (the-as vector (-> this attempts s5-1)) 409.6 (new 'static 'rgba :a #x40))) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts))) (defmethod debug-draw-tris ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-tris))) (let* ((v1-3 (-> this tris s5-0 ctri)) - (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) - ) - (add-debug-outline-triangle - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> v1-3 vertex)) - (-> v1-3 vertex 1) - (-> v1-3 vertex 2) - t1-0 - ) - ) - ) - (none) - ) + (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64))) + (add-debug-outline-triangle #t + (bucket-id debug-no-zbuf) + (the-as vector (-> v1-3 vertex)) + (-> v1-3 vertex 1) + (-> v1-3 vertex 2) + t1-0))) + (none)) -(let ((v1-1 - (new 'static 'surface - :name '*rotate-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 153600.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags (surface-flags moving-ground) - ) - ) - ) +(let ((v1-1 (new 'static + 'surface + :name '*rotate-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags + (surface-flags moving-ground)))) (define *rotate-surface* v1-1) (set! *rotate-surface* v1-1) (set! (-> v1-1 mult-hook) - (the-as - (function surface surface surface int none) - (lambda ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) (if (= arg3 1) - (set! (-> arg0 fric) 151756.8) - ) - ) - ) - ) + (the-as (function surface surface surface int none) + (lambda ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) (if (= arg3 1) (set! (-> arg0 fric) 151756.8))))) (set! (-> v1-1 touch-hook) nothing) - (set! (-> v1-1 active-hook) nothing) - ) + (set! (-> v1-1 active-hook) nothing)) -(let ((v1-2 (new 'static 'surface - :name '*no-walk-surface* - :turnv 0.5 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.7 - :target-speed 0.7 - :seek0 24576.0 - :seek90 24576.0 - :seek180 24576.0 - :fric 23756.8 - :nonlin-fric-dist 4091904.0 - :slope-slip-angle 16384.0 - :bend-speed 4.0 - :alignv 0.5 - :slope-up-traction 0.9 - :align-speed 1.0 - :flags (surface-flags no-turn-around always-rotate-toward-transv) - ) - ) - ) +(let ((v1-2 (new 'static + 'surface + :name '*no-walk-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 0.9 + :align-speed 1.0 + :flags + (surface-flags no-turn-around always-rotate-toward-transv)))) (define *no-walk-surface* v1-2) (set! *no-walk-surface* v1-2) (set! (-> v1-2 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-2 touch-hook) nothing) - (set! (-> v1-2 active-hook) nothing) - ) + (set! (-> v1-2 active-hook) nothing)) diff --git a/goal_src/jak1/engine/collide/collide-frag-h.gc b/goal_src/jak1/engine/collide/collide-frag-h.gc index 58f93e3135..9d1bf2813d 100644 --- a/goal_src/jak1/engine/collide/collide-frag-h.gc +++ b/goal_src/jak1/engine/collide/collide-frag-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/math/vector-h.gc") (require "engine/draw/drawable-tree-h.gc") (require "engine/draw/drawable-inline-array-h.gc") @@ -25,39 +24,25 @@ ; TODO - defined in drawable, but needed in collide-frag (define-extern sphere-cull (function vector symbol)) -(deftype collide-frag-vertex (vector) - () - ) - +(deftype collide-frag-vertex (vector) ()) (deftype collide-frag-mesh (basic) - ((packed-data uint32) - (pat-array uint32) - (strip-data-len uint16) - (poly-count uint16) - (base-trans vector :inline) - (vertex-count uint8 :overlay-at (-> base-trans w)) - (vertex-data-qwc uint8 :offset 29) - (total-qwc uint8 :offset 30) - (unused uint8 :offset 31) - ) - ) - + ((packed-data uint32) + (pat-array uint32) + (strip-data-len uint16) + (poly-count uint16) + (base-trans vector :inline) + (vertex-count uint8 :overlay-at (-> base-trans w)) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31))) (deftype collide-fragment (drawable) - ((mesh collide-frag-mesh :offset 8) - ) - ) - + ((mesh collide-frag-mesh :offset 8))) (deftype drawable-inline-array-collide-fragment (drawable-inline-array) - ((data collide-fragment 1 :inline) - (pad uint32) - ) - ) - + ((data collide-fragment 1 :inline) + (pad uint32))) (deftype drawable-tree-collide-fragment (drawable-tree) - ((data-override drawable-inline-array :overlay-at (-> data 0)) - ) - ) + ((data-override drawable-inline-array :overlay-at (-> data 0)))) diff --git a/goal_src/jak1/engine/collide/collide-frag.gc b/goal_src/jak1/engine/collide/collide-frag.gc index 9be5f15abe..75f48038d9 100644 --- a/goal_src/jak1/engine/collide/collide-frag.gc +++ b/goal_src/jak1/engine/collide/collide-frag.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/level/bsp.gc") (require "engine/collide/collide-frag-h.gc") @@ -14,78 +13,58 @@ ;; DECOMP BEGINS (defmethod login ((this drawable-tree-collide-fragment)) - this - ) + this) (defmethod draw ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) "Note: this doesn't do anything (sadly)" (when *display-render-collision* (dotimes (s4-0 (-> this length)) - (draw (-> this data s4-0) (-> this data s4-0) arg1) - ) - ) + (draw (-> this data s4-0) (-> this data s4-0) arg1))) 0 - (none) - ) + (none)) (defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) - arg1 - ) + arg1) (defmethod collide-with-box ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) "Collide everything in the tree with a box. Length arg doesn't matter here." (collide-with-box (-> this data-override) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod collide-y-probe ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data-override) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod collide-ray ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data-override) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) - (let ((s5-0 (if (logtest? arg1 1) - 53 - 50 - ) - ) - (s4-0 (-> this mesh)) - ) + (let ((s5-0 (if (logtest? arg1 1) 53 50)) + (s4-0 (-> this mesh))) (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) (+! (-> arg0 data s5-0 count) 1) (let ((v1-11 (+ (asize-of this) (asize-of s4-0)))) (+! (-> arg0 data s5-0 used) v1-11) - (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) - ) + (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15)))) (set! (-> arg0 data (+ s5-0 1) name) "collision-poly") (+! (-> arg0 data (+ s5-0 1) count) (-> s4-0 poly-count)) (let ((v1-22 (+ (-> s4-0 strip-data-len) (-> s4-0 poly-count)))) (+! (-> arg0 data (+ s5-0 1) used) v1-22) - (+! (-> arg0 data (+ s5-0 1) total) v1-22) - ) + (+! (-> arg0 data (+ s5-0 1) total) v1-22)) (set! (-> arg0 data (+ s5-0 2) name) "collision-vertex") (+! (-> arg0 data (+ s5-0 2) count) (-> s4-0 vertex-count)) (let ((v1-31 (* (-> s4-0 vertex-data-qwc) 16))) (+! (-> arg0 data (+ s5-0 2) used) v1-31) (let ((v0-2 (+ (-> arg0 data (+ s5-0 2) total) v1-31))) (set! (-> arg0 data (+ s5-0 2) total) v0-2) - (the-as collide-fragment v0-2) - ) - ) - ) - ) + (the-as collide-fragment v0-2))))) (defmethod login ((this drawable-inline-array-collide-fragment)) - this - ) + this) (defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) ;; if we wanted to draw collide-fragment's we'd do it here. @@ -103,52 +82,34 @@ ; ) ;; (add-debug-point #t (bucket-id debug) (-> this bsphere)) 0 - (none) - ) + (none)) -(defmethod draw ((this drawable-inline-array-collide-fragment) - (arg0 drawable-inline-array-collide-fragment) - (arg1 display-frame) - ) +(defmethod draw ((this drawable-inline-array-collide-fragment) (arg0 drawable-inline-array-collide-fragment) (arg1 display-frame)) (dotimes (s4-0 (-> this length)) - (let ((s3-0 (-> this data s4-0))) - (if (sphere-cull (-> s3-0 bsphere)) - (draw s3-0 s3-0 arg1) - ) - ) - ) + (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) (draw s3-0 s3-0 arg1)))) 0 - (none) - ) + (none)) (defmethod collide-with-box ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod collide-y-probe ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod collide-ray ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 - (none) - ) + (none)) (defmethod mem-usage ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) - (let ((v1-7 32)) - (+! (-> arg0 data 0 used) v1-7) - (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) - ) + (let ((v1-7 32)) (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))) (dotimes (s3-0 (-> this length)) - (mem-usage (-> this data s3-0) arg0 arg1) - ) - this - ) + (mem-usage (-> this data s3-0) arg0 arg1)) + this) diff --git a/goal_src/jak1/engine/collide/collide-func-h.gc b/goal_src/jak1/engine/collide/collide-func-h.gc index 0da23a751c..fde2dd5373 100644 --- a/goal_src/jak1/engine/collide/collide-func-h.gc +++ b/goal_src/jak1/engine/collide/collide-func-h.gc @@ -1,8 +1,9 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") + ;; name: collide-func-h.gc ;; name in dgo: collide-func-h ;; dgos: GAME, ENGINE -;; empty! \ No newline at end of file +;; empty! diff --git a/goal_src/jak1/engine/collide/collide-func.gc b/goal_src/jak1/engine/collide/collide-func.gc index e8da2c2aeb..99e12a2ef2 100644 --- a/goal_src/jak1/engine/collide/collide-func.gc +++ b/goal_src/jak1/engine/collide/collide-func.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/math/vector.gc") (require "kernel/gkernel-h.gc") @@ -9,7 +8,6 @@ ;; name in dgo: collide-func ;; dgos: GAME, ENGINE - ;; This file contains the primitive intersection functions used for collision. ;; Most take a description of primitive and a "probe" ;; The probe has an origin and a direction. The length of the direction vector is the length @@ -28,20 +26,10 @@ (defconstant COLLISION_MISS -100000000.0) - - (defun raw-ray-sphere-intersect ((arg0 float)) "DANGER: this function takes two arguments by vf registers. As a result, it doesn't work properly in OpenGOAL. See the functions below." - (local-vars - (v1-1 float) - (v1-2 float) - (v1-4 number) - (a0-1 float) - (a0-2 float) - (a0-3 int) - (a1-0 float) - ) + (local-vars (v1-1 float) (v1-2 float) (v1-4 number) (a0-1 float) (a0-2 float) (a0-3 int) (a1-0 float)) (crash!) (rlet ((Q :class vf) (vf0 :class vf) @@ -53,8 +41,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (.mov vf3 arg0) ;; vf3 = radius ;; sphere is at the origin, vf1 is source of the ray (o) @@ -80,8 +67,7 @@ (b! (< (the-as int a1-0) 0) cfg-7 :delay (set! a0-2 a0-1)) (.mul.vf vf4 vf0 Q :mask #b1000) (.sub.vf vf9 vf8 vf7) - (b! (= a0-2 v1-0) cfg-6 :delay (.mov v1-1 vf5)) - ) + (b! (= a0-2 v1-0) cfg-6 :delay (.mov v1-1 vf5))) (.sqrt.vf Q vf9 :ftf #b1) (b! (>= (the-as int v1-1) 0) cfg-6 :delay (.mov v1-2 vf9)) (b! (< (the-as int v1-2) 0) cfg-6 :delay 1.0) @@ -93,33 +79,21 @@ (.add.w.vf vf9 vf5 vf9 :mask #b10) (.mov a0-3 vf6) (.mul.w.vf vf9 vf9 vf4 :mask #b10) - (b! - (< (logand (the-as uint v1-4) (the-as uint a0-3)) 0) - cfg-6 - :delay - (.sub.y.vf vf4 vf0 vf9) - ) + (b! (< (logand (the-as uint v1-4) (the-as uint a0-3)) 0) cfg-6 :delay (.sub.y.vf vf4 vf0 vf9)) (b! #t cfg-7 :delay (.mov result vf4)) (label cfg-6) (set! result -100000000.0) (label cfg-7) - (the-as float result) - ) - ) - ) + (the-as float result)))) (defmacro pc-port-do-raw-ray-sphere-intersect (rad vf1-val vf2-val) "Calls to raw-ray-sphere-intersect should be replaced with this macro, and this should be given vf1, vf2, which contain the origin and direction of the probe." `(let ((vf1-storage (new 'stack-no-clear 'vector)) - (vf2-storage (new 'stack-no-clear 'vector)) - ) - (.svf (&-> vf1-storage quad) ,vf1-val) - (.svf (&-> vf2-storage quad) ,vf2-val) - (pc-port-raw-ray-sphere-implementation ,rad vf1-storage vf2-storage) - ) - ) - + (vf2-storage (new 'stack-no-clear 'vector))) + (.svf (&-> vf1-storage quad) ,vf1-val) + (.svf (&-> vf2-storage quad) ,vf2-val) + (pc-port-raw-ray-sphere-implementation ,rad vf1-storage vf2-storage))) (defun pc-port-raw-ray-sphere-implementation ((rad float) (vf1-val vector) (vf2-val vector)) "This is one of the main primitives for collision. @@ -130,15 +104,7 @@ - too far away (return MISS) - inside (return 0) " - (local-vars - (v1-1 int) - (v1-2 int) - (v1-4 int) - (a0-1 float) - (a0-2 float) - (a0-3 int) - (a1-0 int) - ) + (local-vars (v1-1 int) (v1-2 int) (v1-4 int) (a0-1 float) (a0-2 float) (a0-3 int) (a1-0 int)) (rlet ((Q :class vf) (vf0 :class vf) (vf1 :class vf) @@ -149,8 +115,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (.lvf vf1 (&-> vf1-val quad)) (.lvf vf2 (&-> vf2-val quad)) @@ -189,71 +154,53 @@ (.add.w.vf vf9 vf5 vf9 :mask #b10) (.mov a0-3 vf6) (.mul.w.vf vf9 vf9 vf4 :mask #b10) - ;; too far. - (b! (< (logand (the-as int v1-4) (the-as int a0-3)) 0) - cfg-6 - :delay (.sub.y.vf vf4 vf0 vf9) - ) + (b! (< (logand (the-as int v1-4) (the-as int a0-3)) 0) cfg-6 :delay (.sub.y.vf vf4 vf0 vf9)) (b! #t cfg-7 :delay (.mov result vf4)) (label cfg-6) (set! result -100000000.0) (label cfg-7) - (the-as float result) - ) - ) - ) - + (the-as float result)))) (defun ray-sphere-intersect ((ray-origin vector) (ray-dir vector) (sph-origin vector) (radius float)) "Intersect a ray and sphere. Will return 0 if you are in the sphere, -huge number if you don't hit it. Returns the length of the ray to the first intersection." - ;; offset stuff as if the sphere is at the origin. (rlet ((vf1 :class vf) - (vf2 :class vf) - ) + (vf2 :class vf)) (.lvf vf1 (&-> ray-origin quad)) (.lvf vf2 (&-> sph-origin quad)) (.sub.vf vf1 vf1 vf2) ;; the sphere is at the origin in the actual intersection. (.lvf vf2 (&-> ray-dir quad)) ;;(raw-ray-sphere-intersect radius) - (pc-port-do-raw-ray-sphere-intersect radius vf1 vf2) - ) - ) + (pc-port-do-raw-ray-sphere-intersect radius vf1 vf2))) (defun ray-circle-intersect ((ray-origin vector) (ray-dir vector) (circle-origin vector) (radius float)) "Intersect ray with circle. Circle is on the y plane and this throws out the y components of ray-origin, circle-origin, and ray-dir" (rlet ((vf0 :class vf) (vf1 :class vf) - (vf2 :class vf) - ) - (init-vf0-vector) - (.lvf vf1 (&-> ray-origin quad)) - (.mov.vf vf1 vf0 :mask #b10) - (.lvf vf2 (&-> circle-origin quad)) - (.mov.vf vf2 vf0 :mask #b10) - (.sub.vf vf1 vf1 vf2) - (.lvf vf2 (&-> ray-dir quad)) - (.mov.vf vf2 vf0 :mask #b10) - ;;(raw-ray-sphere-intersect radius) - (pc-port-do-raw-ray-sphere-intersect radius vf1 vf2) - ) - ) + (vf2 :class vf)) + (init-vf0-vector) + (.lvf vf1 (&-> ray-origin quad)) + (.mov.vf vf1 vf0 :mask #b10) + (.lvf vf2 (&-> circle-origin quad)) + (.mov.vf vf2 vf0 :mask #b10) + (.sub.vf vf1 vf1 vf2) + (.lvf vf2 (&-> ray-dir quad)) + (.mov.vf vf2 vf0 :mask #b10) + ;;(raw-ray-sphere-intersect radius) + (pc-port-do-raw-ray-sphere-intersect radius vf1 vf2))) -(defun ray-cylinder-intersect ((ray-origin vector) (ray-dir vector) (cyl-origin vector) (cyl-axis vector) (cyl-rad float) (cyl-len float) (pt-out vector)) +(defun ray-cylinder-intersect ((ray-origin vector) (ray-dir vector) + (cyl-origin vector) + (cyl-axis vector) + (cyl-rad float) + (cyl-len float) + (pt-out vector)) "Intersect with a cylinder. Currently this is untested." - (local-vars - (v0-1 float) - (v1-0 int) - (v1-2 int) - (a0-1 int) - (a0-2 int) - (a0-4 int) - (a0-5 int) - ) + (local-vars (v0-1 float) (v1-0 int) (v1-2 int) (a0-1 int) (a0-2 int) (a0-4 int) (a0-5 int)) (rlet ((vf1 :class vf) (vf10 :class vf) (vf11 :class vf) @@ -267,8 +214,7 @@ (vf19 :class vf) (vf2 :class vf) (vf20 :class vf) - (vf21 :class vf) - ) + (vf21 :class vf)) (.lvf vf10 (&-> ray-origin quad)) (.lvf vf12 (&-> cyl-origin quad)) (.sub.vf vf15 vf10 vf12) @@ -290,8 +236,7 @@ (.mov a0-1 vf18) (let ((v1-1 (logand v1-0 (the-as uint a0-1)))) (.sub.vf vf1 vf15 vf1) - (b! (< v1-1 0) cfg-6 :delay (.sub.vf vf2 vf11 vf2)) - ) + (b! (< v1-1 0) cfg-6 :delay (.sub.vf vf2 vf11 vf2))) (.mov v1-2 vf19) (.mov a0-2 vf20) (b! (>= (the-as int (logior v1-2 (the-as uint a0-2))) 0) cfg-6 :delay (nop!)) @@ -303,22 +248,14 @@ (.mul.y.vf vf13 vf13 vf16) (.sub.x.vf vf19 vf16 vf14) (.mov a0-4 vf16) - (b! - (< (the-as int a0-4) 0) - cfg-6 - :delay - (.add.vf vf12 vf12 vf13 :mask #b111) - ) + (b! (< (the-as int a0-4) 0) cfg-6 :delay (.add.vf vf12 vf12 vf13 :mask #b111)) (.mov a0-5 vf19) (b! (>= (the-as int a0-5) 0) cfg-6 :delay (.svf (&-> pt-out quad) vf12)) - (b! #t cfg-7 :delay (set! v0-1 v1-4)) - ) + (b! #t cfg-7 :delay (set! v0-1 v1-4))) (label cfg-6) (set! v0-1 -100000000.0) (label cfg-7) - v0-1 - ) - ) + v0-1)) (defun ray-plane-intersect ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 vector) (arg6 vector)) "Unused." @@ -334,8 +271,7 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (.lvf vf3 (&-> arg5 quad)) (.lvf vf1 (&-> arg4 quad)) @@ -360,8 +296,7 @@ (.mov a2-1 vf8) (.isqrt.vf Q vf0 vf5 :fsf #b11 :ftf #b0) (let ((f1-0 a2-1) - (f2-0 v1-0) - ) + (f2-0 v1-0)) (cond ((!= f2-0 0.0) (let ((f1-1 (/ f1-0 f2-0))) @@ -375,34 +310,23 @@ (.add.mul.w.vf vf7 vf6 vf0 acc :mask #b111) (.svf (&-> arg0 quad) vf7) (.mov v1-1 vf7) - v0-0 - ) - ) - ) - (else - -100000000.0 - ) - ) - ) - ) - ) + v0-0))) + (else -100000000.0))))) ;; ray-triangle-intersect (unused) ;; collide-do-primitives (used in moving-sphere-triangle-intersect) (def-mips2c collide-do-primitives (function float)) + ;; moving-sphere-triangle-intersect (used in cam) (def-mips2c moving-sphere-triangle-intersect (function vector vector float collide-cache-tri vector vector float)) + ;; moving-sphere-sphere-intersect (used in collide) (defun moving-sphere-sphere-intersect ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((f30-0 (ray-sphere-intersect arg0 arg1 arg2 (+ (-> arg0 w) (-> arg2 w))))) (when (>= f30-0 0.0) (let ((s3-1 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg0) (-> arg0 w)))) (vector+*! arg3 arg0 arg1 f30-0) - (vector+! arg3 arg3 s3-1) - ) - ) - f30-0 - ) - ) + (vector+! arg3 arg3 s3-1))) + f30-0)) ;; moving-sphere-moving-sphere-intersect (unused) diff --git a/goal_src/jak1/engine/collide/collide-h.gc b/goal_src/jak1/engine/collide/collide-h.gc index 235cf56d8f..22ec7f4fd7 100644 --- a/goal_src/jak1/engine/collide/collide-h.gc +++ b/goal_src/jak1/engine/collide/collide-h.gc @@ -1,8 +1,9 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") + ;; name: collide-h.gc ;; name in dgo: collide-h ;; dgos: GAME, ENGINE -(define *collide-test-flag* #f) \ No newline at end of file +(define *collide-test-flag* #f) diff --git a/goal_src/jak1/engine/collide/collide-mesh-h.gc b/goal_src/jak1/engine/collide/collide-mesh-h.gc index a7e86165f1..b358a898b3 100644 --- a/goal_src/jak1/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak1/engine/collide/collide-mesh-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "kernel-defs.gc") ;; name: collide-mesh-h.gc @@ -20,12 +19,10 @@ ;; The triangle involved in collision ;; Note: this is reused for the background collision system. (deftype collide-tri-result (structure) - ((vertex vector 3 :inline) - (intersect vector :inline) - (normal vector :inline) - (pat pat-surface) - ) - ) + ((vertex vector 3 :inline) + (intersect vector :inline) + (normal vector :inline) + (pat pat-surface))) ;;;;;;;;;;;;;;;;;;;; ;; static mesh data @@ -35,34 +32,29 @@ ;; The vertex indices index into the collide-mesh vertex-data array. ;; Due to using uint8's you only get 256 vertices. (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3) - (unused uint8) - (pat pat-surface) - ) - :pack-me - ) + ((vertex-index uint8 3) + (unused uint8) + (pat pat-surface)) + :pack-me) ;; og:preserve-this (declare-type collide-mesh-cache-tri structure) ;; A collision mesh. Note that's it's bound to a specific joint. (deftype collide-mesh (basic) - ((joint-id int32) - (num-tris uint32) - (num-verts uint32) - (vertex-data (inline-array vector)) - (tris collide-mesh-tri 1 :inline :offset 32) - ) + ((joint-id int32) + (num-tris uint32) + (num-verts uint32) + (vertex-data (inline-array vector)) + (tris collide-mesh-tri 1 :inline :offset 32)) (:methods - (debug-draw-tris (_type_ process-drawable int) none) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) - (populate-cache! (_type_ collide-mesh-cache-tri matrix) none) - (collide-mesh-math-1 (_type_ object object) none) - (collide-mesh-math-2 (_type_ object object object) none) - ) - ) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (populate-cache! (_type_ collide-mesh-cache-tri matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none))) ;;;;;;;;;;;;;;;;;;;; ;; cache @@ -78,17 +70,14 @@ (defconstant COLLIDE_MESH_CACHE_SIZE #xa000) (deftype collide-mesh-cache (basic) - ((used-size uint32) - (max-size uint32) - (id uint64) - (data uint8 40960 :offset 32) - ) + ((used-size uint32) + (max-size uint32) + (id uint64) + (data uint8 40960 :offset 32)) (:methods - (allocate! (_type_ int) int) - (is-id? (_type_ int) symbol) - (next-id! (_type_) uint) - ) - ) + (allocate! (_type_ int) int) + (is-id? (_type_ int) symbol) + (next-id! (_type_) uint))) (defmethod next-id! ((obj collide-mesh-cache)) "Reset all used entries in the cache and increment the id. @@ -101,30 +90,22 @@ (let ((v0 (+ v1 1))) ;; beql v0, r0, L3 ;; addiu v0, r0, 1 (only taken if v0 = 0) - (if (= v0 0) - (set! v0 (the uint 1)) - ) + (if (= v0 0) (set! v0 (the uint 1))) ;; L3: ;; sd v0, 12(a0) (set! (-> obj id) v0) - v0 - ) - ) - ) + v0))) (defmethod is-id? ((this collide-mesh-cache) (arg0 int)) "Is this our id?" - (= (-> this id) arg0) - ) + (= (-> this id) arg0)) ;; possibly this is stored in the data of the collide-mesh-cache (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline) - (normal vector :inline) - (bbox4w bounding-box4w :inline) - (pat pat-surface :overlay-at (-> normal w)) - ) - ) + ((vertex vector 3 :inline) + (normal vector :inline) + (bbox4w bounding-box4w :inline) + (pat pat-surface :overlay-at (-> normal w)))) ;; only allocate if we don't have an existing one. (define-perm *collide-mesh-cache* collide-mesh-cache (new 'global 'collide-mesh-cache)) @@ -132,5 +113,7 @@ ;; og:preserve-this ;; in all cases, re-init. (set! (-> *collide-mesh-cache* id) 1) + (set! (-> *collide-mesh-cache* used-size) 0) + (set! (-> *collide-mesh-cache* max-size) COLLIDE_MESH_CACHE_SIZE) diff --git a/goal_src/jak1/engine/collide/collide-mesh.gc b/goal_src/jak1/engine/collide/collide-mesh.gc index b655bb99e8..2625578f21 100644 --- a/goal_src/jak1/engine/collide/collide-mesh.gc +++ b/goal_src/jak1/engine/collide/collide-mesh.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/pat-h.gc") (require "engine/debug/debug.gc") (require "engine/collide/collide-mesh-h.gc") @@ -14,27 +13,21 @@ (defmethod asize-of ((this collide-mesh)) "Compute the size in memory of a collide-mesh. Somehow this only counts num-tris and not verts." - (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) - ) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8)))) (defmethod mem-usage ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a collide-mesh." (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) - (let ((v1-6 (asize-of this))) - (+! (-> arg0 data 78 used) v1-6) - (+! (-> arg0 data 78 total) (logand -16 (+ v1-6 15))) - ) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 78 used) v1-6) (+! (-> arg0 data 78 total) (logand -16 (+ v1-6 15)))) (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) (let ((v1-16 (* (-> this num-verts) 16))) (+! (-> arg0 data 78 used) v1-16) - (+! (-> arg0 data 78 total) (logand -16 (+ v1-16 15))) - ) - (the-as collide-mesh 0) - ) + (+! (-> arg0 data 78 total) (logand -16 (+ v1-16 15)))) + (the-as collide-mesh 0)) (defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) "Draw a collide-mesh." @@ -46,17 +39,14 @@ (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) - (vf7 :class vf) - ) + (vf7 :class vf)) (init-vf0-vector) (let ((s5-0 (the-as object (-> this tris))) - (s4-0 (-> arg0 node-list data arg1 bone transform)) - ) + (s4-0 (-> arg0 node-list data arg1 bone transform))) (countdown (s3-0 (-> this num-tris)) (let ((a2-1 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) - (t0-0 (new 'stack-no-clear 'vector)) - ) + (t0-0 (new 'stack-no-clear 'vector))) (.lvf vf4 (&-> s4-0 vector 0 quad)) (.lvf vf5 (&-> s4-0 vector 1 quad)) (.lvf vf6 (&-> s4-0 vector 2 quad)) @@ -80,32 +70,20 @@ (.svf (&-> a2-1 quad) vf1) (.svf (&-> a3-0 quad) vf2) (.svf (&-> t0-0 quad) vf3) - (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0) - ) - ) - (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)) - ) - ) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0))) + (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)))) 0 - (none) - ) - ) + (none))) (deftype sopt-work (structure) - ((intersect vector :inline) - (sphere-bbox4w bounding-box4w :inline) - ) - ) - + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline))) (defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) (deftype spat-work (structure) - ((intersect vector :inline) - (sphere-bbox4w bounding-box4w :inline) - ) - ) - + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline))) (defmethod-mips2c "(method 11 collide-mesh)" 11 collide-mesh) @@ -121,14 +99,11 @@ (a3-0 (-> this data)) (a2-0 (-> this max-size)) (v1-2 (* v1-1 16)) - (a3-1 (&+ a3-0 a1-1)) - ) + (a3-1 (&+ a3-0 a1-1))) (let ((t1-0 (- a2-0 (the-as uint v1-2))) - (t0-0 (-> this id)) - ) + (t0-0 (-> this id))) (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) - (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) - ) + (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1))))) (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) (label cfg-4) (set! a1-2 v1-2) @@ -142,10 +117,7 @@ (format 0 "ERROR: Attempted to allocate something bigger than the entire mesh cache!~%") (set! v0-0 (the-as (pointer uint8) #f)) (label cfg-7) - (the-as int v0-0) - ) - ) - ) + (the-as int v0-0)))) (defmethod populate-cache! ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) (local-vars (t0-2 uint)) @@ -163,13 +135,11 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) + (vf9 :class vf)) (init-vf0-vector) (nop!) (let ((t0-0 (scratchpad-object int)) - (v1-0 (-> this num-verts)) - ) + (v1-0 (-> this num-verts))) (nop!) (let ((a3-0 (-> this vertex-data))) (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 vector 0 quad))) @@ -228,29 +198,23 @@ (.svf (+ t0-1 16) vf10) (nop!) (.svf (+ t0-1 32) vf11) - (b! (> (the-as int v1-0) 0) cfg-2 :delay (.svf (+ t0-1 48) vf12)) - ) - ) - ) + (b! (> (the-as int v1-0) 0) cfg-2 :delay (.svf (+ t0-1 48) vf12))))) (label cfg-3) (let ((v1-1 (the-as collide-mesh-tri (-> this tris)))) (nop!) (let ((a2-1 (scratchpad-object int)) - (a0-1 (-> this num-tris)) - ) + (a0-1 (-> this num-tris))) (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> v1-1 vertex-index 0))) - (let* ((a1-1 (&+ arg0 -96)) + (let* ((a1-1 (&+ arg0 -96)) (a3-1 (-> v1-1 vertex-index 1)) (t0-3 (* t0-2 16)) (t2-0 (-> v1-1 vertex-index 2)) (t1-0 (* a3-1 16)) - (a3-2 (-> v1-1 pat)) - ) + (a3-2 (-> v1-1 pat))) (let* ((t2-1 (* t2-0 16)) (t0-4 (+ t0-3 a2-1)) (t1-1 (+ t1-0 a2-1)) - (t2-2 (+ t2-1 a2-1)) - ) + (t2-2 (+ t2-1 a2-1))) (label cfg-5) (+! a0-1 -1) (.lvf vf1 t0-4) @@ -283,14 +247,7 @@ (.add.mul.z.vf vf7 vf0 vf7 acc :mask #b1000) (set! t1-1 (+ t2-4 a2-1)) (.isqrt.vf Q vf0 vf7 :fsf #b11 :ftf #b11) - (set! t2-2 (+ t3-0 a2-1)) - ) - ) - ) - ) - ) - ) - ) + (set! t2-2 (+ t3-0 a2-1))))))))) (.ftoi.vf vf8 vf8) (nop!) (.ftoi.vf vf9 vf9) @@ -305,22 +262,14 @@ (.svf (&-> a1-1 normal quad) vf6) (nop!) (set! (-> a1-1 normal w) (the-as float a3-2)) - (b! (nonzero? a0-1) cfg-5 :delay (set! a3-2 (-> v1-1 pat))) - ) - ) - ) + (b! (nonzero? a0-1) cfg-5 :delay (set! a3-2 (-> v1-1 pat)))))) (label cfg-6) 0 - (none) - ) - ) + (none))) (deftype oot-work (structure) - ((intersect vector :inline) - (sphere-bbox4w bounding-box4w :inline) - ) - ) - + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline))) (defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars @@ -332,8 +281,7 @@ (a1-4 uint128) (a1-7 uint) (a2-1 uint128) - (a2-2 uint128) - ) + (a2-2 uint128)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -341,13 +289,11 @@ (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) - (vf6 :class vf) - ) + (vf6 :class vf)) (init-vf0-vector) (set! zero (the-as uint128 0)) (let ((s5-0 (new 'stack-no-clear 'matrix)) - (s4-0 arg0) - ) + (s4-0 arg0)) (.lvf vf2 (&-> arg1 quad)) (let ((s3-0 (-> this num-tris))) (.sub.w.vf vf5 vf2 vf2) @@ -360,25 +306,13 @@ (.svf (&-> s5-0 vector 2 quad) vf6) (label cfg-1) (b! (zero? s3-0) cfg-7 :delay (set! a2-1 (-> s4-0 bbox4w min quad))) - (+! s3-0 -1) - ) - (let ((a1-1 (-> s4-0 bbox4w max quad))) - (.pcgtw a2-2 a2-1 a0-1) - (.pcgtw a1-2 v1-0 a1-1) - ) + (+! s3-0 -1)) + (let ((a1-1 (-> s4-0 bbox4w max quad))) (.pcgtw a2-2 a2-1 a0-1) (.pcgtw a1-2 v1-0 a1-1)) (.por a1-3 a2-2 a1-2) (nop!) (.ppach a1-4 zero a1-3) - (let ((a1-5 (shl (the-as int a1-4) 16))) - (nop!) - (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s4-0 (&+ s4-0 96))) - ) - (closest-pt-in-triangle - (the-as vector (-> s5-0 vector)) - arg1 - (the-as matrix (-> s4-0 vertex)) - (-> s4-0 normal) - ) + (let ((a1-5 (shl (the-as int a1-4) 16))) (nop!) (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s4-0 (&+ s4-0 96)))) + (closest-pt-in-triangle (the-as vector (-> s5-0 vector)) arg1 (the-as matrix (-> s4-0 vertex)) (-> s4-0 normal)) (.lvf vf1 (&-> s5-0 vector 0 quad)) (.lvf vf2 (&-> arg1 quad)) (set! v1-0 (-> s5-0 vector 1 quad)) @@ -392,15 +326,5 @@ (.sub.w.vf vf3 vf3 vf4 :mask #b1000) (.add.w.vf vf3 vf0 vf3 :mask #b10) (.mov a1-7 vf3) - (b! (>= (the-as int a1-7) 0) cfg-1 :delay (set! s4-0 (&+ s4-0 96))) - ) - (let ((v0-1 #t)) - (b! #t cfg-8 :delay (nop!)) - (the-as none 0) - (label cfg-7) - (set! v0-1 #f) - (label cfg-8) - v0-1 - ) - ) - ) \ No newline at end of file + (b! (>= (the-as int a1-7) 0) cfg-1 :delay (set! s4-0 (&+ s4-0 96)))) + (let ((v0-1 #t)) (b! #t cfg-8 :delay (nop!)) (the-as none 0) (label cfg-7) (set! v0-1 #f) (label cfg-8) v0-1))) diff --git a/goal_src/jak1/engine/collide/collide-probe.gc b/goal_src/jak1/engine/collide/collide-probe.gc index 32a7a37e22..8016ee8320 100644 --- a/goal_src/jak1/engine/collide/collide-probe.gc +++ b/goal_src/jak1/engine/collide/collide-probe.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/level/level-h.gc") (require "kernel/gkernel.gc") (require "engine/collide/collide-cache-h.gc") @@ -28,16 +27,11 @@ (defun creates-new-method? ((arg0 type) (arg1 int)) "Is the method with the given ID in the given type a new method for this type?" ;; does our parent have it? - (let ((v1-1 (-> arg0 parent allocated-length))) - (-> arg0 allocated-length) - (>= arg1 (the-as int v1-1)) - ) - ) + (let ((v1-1 (-> arg0 parent allocated-length))) (-> arg0 allocated-length) (>= arg1 (the-as int v1-1)))) (defun overrides-parent-method? ((arg0 type) (arg1 int)) "Does the method with the given ID in the given type override a method of its parent?" - (!= (-> arg0 method-table arg1) (-> arg0 parent method-table arg1)) - ) + (!= (-> arg0 method-table arg1) (-> arg0 parent method-table arg1))) (defun describe-methods ((arg0 type)) "Print information about the methods of a type." @@ -47,25 +41,12 @@ (format #t "~3d:~%" s4-0) (while (!= s3-0 basic) (cond - ((creates-new-method? s3-0 s4-0) - (format #t " created by ~s.~%" (symbol->string (-> s3-0 symbol))) - (set! s3-0 basic) - ) + ((creates-new-method? s3-0 s4-0) (format #t " created by ~s.~%" (symbol->string (-> s3-0 symbol))) (set! s3-0 basic)) ((overrides-parent-method? s3-0 s4-0) (format #t " overridden by ~s.~%" (symbol->string (-> s3-0 symbol))) - (set! s3-0 (-> s3-0 parent)) - ) - (else - (set! s3-0 (-> s3-0 parent)) - ) - ) - ) - ) - ) - ) - #f - ) - + (set! s3-0 (-> s3-0 parent))) + (else (set! s3-0 (-> s3-0 parent)))))))) + #f) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collide Fragment Debug @@ -75,36 +56,31 @@ (defun indent-to ((arg0 int)) "Print out arg0 spaces" (dotimes (s5-0 arg0) - (format #t " ") - ) - (none) - ) + (format #t " ")) + (none)) -(defun-recursive probe-traverse-draw-node none ((arg0 draw-node) (arg1 int)) - "Print out info for a draw node, and recursively its children. They forgot to finish this one." - (indent-to arg1) - (format #t "[~08x] child-count: ~d, flags: ~d, dist: ~f, child: ~a~%" - arg0 - (-> arg0 child-count) - (-> arg0 flags) - (-> arg0 distance) - (-> arg0 child) - ) - (cond - ((nonzero? (-> arg0 flags)) - (let ((s4-0 (-> arg0 child))) - (dotimes (s3-0 (the-as int (-> arg0 child-count))) - (probe-traverse-draw-node (the-as draw-node (+ (the-as uint s4-0) (* s3-0 32))) (+ arg1 1)) - ) - ) - ) - (else - ;; we hit the leaves. - ) - ) - 0 - (none) - ) +(defun-recursive probe-traverse-draw-node + none + ((arg0 draw-node) (arg1 int)) + "Print out info for a draw node, and recursively its children. They forgot to finish this one." + (indent-to arg1) + (format #t + "[~08x] child-count: ~d, flags: ~d, dist: ~f, child: ~a~%" + arg0 + (-> arg0 child-count) + (-> arg0 flags) + (-> arg0 distance) + (-> arg0 child)) + (cond + ((nonzero? (-> arg0 flags)) + (let ((s4-0 (-> arg0 child))) + (dotimes (s3-0 (the-as int (-> arg0 child-count))) + (probe-traverse-draw-node (the-as draw-node (+ (the-as uint s4-0) (* s3-0 32))) (+ arg1 1))))) + (else + ;; we hit the leaves. + )) + 0 + (none)) (defun probe-traverse-inline-array-node ((arg0 drawable-inline-array-node) (arg1 int)) "Print out a drawable-inline-array-node, and recursively all children" @@ -114,13 +90,8 @@ (dotimes (s3-0 s4-0) (indent-to arg1) (format #t "(~3d) ~a~%" s3-0 (-> arg0 data s3-0)) - (if (= (-> arg0 data s3-0 type) draw-node) - (probe-traverse-draw-node (-> arg0 data s3-0) (+ arg1 1)) - ) - ) - ) - (none) - ) + (if (= (-> arg0 data s3-0 type) draw-node) (probe-traverse-draw-node (-> arg0 data s3-0) (+ arg1 1))))) + (none)) (defun probe-traverse-collide-fragment ((arg0 drawable-tree-collide-fragment) (arg1 int)) "Print out all levels of a drawabl-tree-collide-fragment." @@ -130,30 +101,20 @@ (dotimes (s3-0 (+ s4-0 -1)) (indent-to arg1) (if (= (-> arg0 data s3-0 type) drawable-inline-array-node) - (probe-traverse-inline-array-node (the-as drawable-inline-array-node (-> arg0 data s3-0)) (+ arg1 1)) - (format #t "unknown: ~a~%" (-> arg0 data s3-0)) - ) - ) - ) - (none) - ) - + (probe-traverse-inline-array-node (the-as drawable-inline-array-node (-> arg0 data s3-0)) (+ arg1 1)) + (format #t "unknown: ~a~%" (-> arg0 data s3-0))))) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collide Probe Implementation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype collide-probe-stack-elem (structure) - ((child uint32) - (count uint32) - ) - ) - + ((child uint32) + (count uint32))) (deftype collide-probe-stack (structure) - ((data collide-probe-stack-elem 1024 :inline) - ) - ) + ((data collide-probe-stack-elem 1024 :inline))) ;;(define *collide-probe-stack* (the-as pointer (+ 4192 #x70000000))) (define *collide-probe-stack* (scratchpad-object collide-probe-stack :offset 4192)) @@ -163,19 +124,15 @@ (def-mips2c collide-probe-node (function (inline-array draw-node) int collide-list int)) (defun print-out ((arg0 int)) - (format *stdcon* "~d~%" arg0) - ) + (format *stdcon* "~d~%" arg0)) (defun collide-probe-instance-tie-collide-frags () 0 - (none) - ) + (none)) ;; collide-probe-instance-tie (def-mips2c collide-probe-instance-tie (function object int collide-list int int)) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collide Probe Setup/Wrappers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -186,16 +143,12 @@ (cond ((< 1 (-> arg0 length)) (let ((v1-1 (-> arg0 data-override))) - (collide-probe-node (-> (the-as drawable-inline-array-node v1-1) data) (-> v1-1 length) arg1) - ) - ) + (collide-probe-node (-> (the-as drawable-inline-array-node v1-1) data) (-> v1-1 length) arg1))) (else - ;; only 1 level in the tree. this is unsupported. - ) - ) + ;; only 1 level in the tree. this is unsupported. + )) 0 - (none) - ) + (none)) (defun collide-probe-instance-tie-tree-make-list ((arg0 drawable-tree-instance-tie) (arg1 collide-list)) "Given a TIE instance tree, make a list. @@ -203,28 +156,18 @@ (cond ((< 1 (-> arg0 length)) (let ((v1-2 (-> arg0 data 0))) - (collide-probe-instance-tie - (-> (the-as drawable-inline-array-node v1-2) data) - (-> (the-as drawable-inline-array-node v1-2) length) - arg1 - 1 - ) - ) - ) + (collide-probe-instance-tie (-> (the-as drawable-inline-array-node v1-2) data) + (-> (the-as drawable-inline-array-node v1-2) length) + arg1 + 1))) ((= (-> arg0 length) 1) ;; between 1 and 8. Set flag 0 to indicate that we are using instance ties. (let ((v1-7 (-> arg0 data 0))) - (collide-probe-instance-tie - (-> (the-as drawable-inline-array-instance-tie v1-7) data) - (-> (the-as drawable-inline-array-instance-tie v1-7) length) - arg1 - 0 - ) - ) - ) - ) - 0 - ) + (collide-probe-instance-tie (-> (the-as drawable-inline-array-instance-tie v1-7) data) + (-> (the-as drawable-inline-array-instance-tie v1-7) length) + arg1 + 0)))) + 0) (defun collide-upload-vu0 () "Upload the probe program to VU0." @@ -233,28 +176,20 @@ ;; reset the buffer (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) - (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length))) - ) + (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length)))) ;; upload the function dma (dma-buffer-add-vu-function gp-0 collide-vu0-block 0) - ;; end dma chain (let* ((v1-1 gp-0) - (a0-5 (the-as object (-> v1-1 base))) - ) + (a0-5 (the-as object (-> v1-1 base)))) (set! (-> (the-as dma-packet a0-5) dma) (new 'static 'dma-tag :id (dma-tag-id end))) (set! (-> (the-as (pointer uint64) a0-5) 1) (the-as uint 0)) - (set! (-> v1-1 base) (&+ (the-as pointer a0-5) 16)) - ) - + (set! (-> v1-1 base) (&+ (the-as pointer a0-5) 16))) ;; go! (.sync.l) - (dma-buffer-send-chain (the-as dma-bank-source #x10008000) gp-0) - ) - ) + (dma-buffer-send-chain (the-as dma-bank-source #x10008000) gp-0))) 0 - (none) - ) + (none)) ;; main collide probe function: @@ -264,7 +199,6 @@ 0 ;; load vu0 program (collide-upload-vu0) - ;; iterate over trees (let ((s5-1 (-> s5-0 drawable-trees))) (dotimes (s4-0 (-> s5-1 length)) @@ -276,56 +210,30 @@ (cond ((< 1 (-> v1-3 length)) (let ((v1-4 (-> v1-3 data 0))) - (collide-probe-instance-tie - (-> (the-as drawable-inline-array-node v1-4) data) - (-> (the-as drawable-inline-array-node v1-4) length) - a2-0 - 1 - ) - ) - ) + (collide-probe-instance-tie (-> (the-as drawable-inline-array-node v1-4) data) + (-> (the-as drawable-inline-array-node v1-4) length) + a2-0 + 1))) ((= (-> v1-3 length) 1) (let ((v1-6 (-> v1-3 data 0))) - (collide-probe-instance-tie - (-> (the-as drawable-inline-array-instance-tie v1-6) data) - (-> (the-as drawable-inline-array-instance-tie v1-6) length) - a2-0 - 0 - ) - ) - ) - ) - ) - 0 - ) + (collide-probe-instance-tie (-> (the-as drawable-inline-array-instance-tie v1-6) data) + (-> (the-as drawable-inline-array-instance-tie v1-6) length) + a2-0 + 0))))) + 0) ((= (-> v1-3 type) drawable-tree-collide-fragment) ;; collide with tfrags (let ((a2-1 arg1)) (cond ((< 1 (-> v1-3 length)) (let ((v1-9 (-> v1-3 data 0))) - (collide-probe-node - (-> (the-as drawable-inline-array-node v1-9) data) - (-> (the-as drawable-inline-array-node v1-9) length) - a2-1 - ) - ) - ) - (else - ) - ) - ) - 0 - ) - (else - ) - ) - ) - ) - ) - ) - (none) - ) + (collide-probe-node (-> (the-as drawable-inline-array-node v1-9) data) + (-> (the-as drawable-inline-array-node v1-9) length) + a2-1))) + (else))) + 0) + (else)))))) + (none)) ;;;;;;;;;;;;;;;;;;; ;; Hacks @@ -336,65 +244,32 @@ (defun distc ((arg0 vector) (arg1 vector)) (let* ((f0-1 (- (-> arg0 x) (-> arg1 x))) (f0-3 (* f0-1 f0-1)) - (f1-2 (- (-> arg0 z) (-> arg1 z))) - ) - (sqrtf (+ f0-3 (* f1-2 f1-2))) - ) - ) + (f1-2 (- (-> arg0 z) (-> arg1 z)))) + (sqrtf (+ f0-3 (* f1-2 f1-2))))) (defun interpolate ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (let ((f0-1 (- arg3 arg1)) (f1-2 (- arg4 arg2)) - (f3-1 (- arg0 arg1)) - ) - (+ arg2 (/ (* f3-1 f1-2) f0-1)) - ) - ) + (f3-1 (- arg0 arg1))) + (+ arg2 (/ (* f3-1 f1-2) f0-1)))) (defun misty-ambush-height ((arg0 vector)) (let* ((a1-0 (new 'static 'vector :x -808960.0 :y 111656.96 :z 3924992.0)) - (f0-0 (distc arg0 a1-0)) - ) + (f0-0 (distc arg0 a1-0))) (cond - ((< f0-0 52019.2) - 111656.96 - ) - ((>= 58982.4 f0-0) - (interpolate f0-0 52019.2 111656.96 58982.4 116776.96) - ) - ((>= 124436.48 f0-0) - (interpolate f0-0 58982.4 116776.96 124436.48 114688.0) - ) - ((>= 219217.92 f0-0) - (interpolate f0-0 124436.48 114688.0 219217.92 113254.4) - ) - (else - 113254.4 - ) - ) - ) - ) + ((< f0-0 52019.2) 111656.96) + ((>= 58982.4 f0-0) (interpolate f0-0 52019.2 111656.96 58982.4 116776.96)) + ((>= 124436.48 f0-0) (interpolate f0-0 58982.4 116776.96 124436.48 114688.0)) + ((>= 219217.92 f0-0) (interpolate f0-0 124436.48 114688.0 219217.92 113254.4)) + (else 113254.4)))) (defun misty-ambush-height-probe ((arg0 vector) (arg1 float)) "Hack to manually compute the ground height in misty ambush." (let ((f0-0 (misty-ambush-height arg0))) (cond - ((< f0-0 (-> arg0 y)) - (/ (- (-> arg0 y) f0-0) arg1) - ) - (else - (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (* 0.00024414062 f0-0) (* 0.00024414062 (-> arg0 y))) - -1.0 - ) - ) - ) - ) + ((< f0-0 (-> arg0 y)) (/ (- (-> arg0 y) f0-0) arg1)) + (else (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (* 0.00024414062 f0-0) (* 0.00024414062 (-> arg0 y))) -1.0)))) (defun pke-collide-test () 0 - (none) - ) - - - - + (none)) diff --git a/goal_src/jak1/engine/collide/collide-shape-h.gc b/goal_src/jak1/engine/collide/collide-shape-h.gc index a1ead91298..2644623ea2 100644 --- a/goal_src/jak1/engine/collide/collide-shape-h.gc +++ b/goal_src/jak1/engine/collide/collide-shape-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/pat-h.gc") (require "engine/math/quaternion.gc") (require "kernel/gkernel-h.gc") @@ -42,7 +41,6 @@ ;; - uses "collide-mesh-cache". ;; - can't collide with water or the background. - ;; The "new" system: ;; - is the only way to collide with the background/water ;; - uses "collide-cache" @@ -53,7 +51,6 @@ ;; foreground meshes. The new system can just import foreground collision meshes ;; into its collide cache. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collision queries: @@ -74,7 +71,6 @@ ;; This will call the reaction function. The default "default-collision-reaction" function is in collide-shape.gc ;; will fill the touching list. - ;; Nav Enemy Collision (made up name) ;; collide-shape-moving-method-58 and integrate-for-enemy-with-move-to-ground are nav-enemy specific. ;; the details aren't super well understood yet. But they basically try to go forward if they aren't blocked. @@ -87,8 +83,8 @@ ;; for platforms, detect if somebody is on the platform. (on-platform-test) ;; uses old system. Sends event adds to rider list. - (declare-type touching-list structure) + (declare-type collide-shape-prim basic) ;; DECOMP BEGINS @@ -101,57 +97,43 @@ ;; Sticky: when you hit the platform, your velocity immediately changes to match the thing. ;; like when Jak lands on a platform. - (deftype collide-sticky-rider (structure) - ((rider-handle handle) - (sticky-prim collide-shape-prim) - (prim-ry float) - (rider-local-pos vector :inline) - ) + ((rider-handle handle) + (sticky-prim collide-shape-prim) + (prim-ry float) + (rider-local-pos vector :inline)) (:methods - (set-rider! (_type_ handle) symbol) - ) - ) - + (set-rider! (_type_ handle) symbol))) (defmethod set-rider! ((this collide-sticky-rider) (arg0 handle)) "Set the rider and clear the primitive." (set! (-> this rider-handle) arg0) (set! (-> this sticky-prim) #f) - #f - ) + #f) ;; A collection of collide-sticky-riders ;; dynamic type. There's one collide-sticky-rider per rider. (deftype collide-sticky-rider-group (basic) - ((num-riders int32) - (allocated-riders int32) - (rider collide-sticky-rider 1 :inline) - ) + ((num-riders int32) + (allocated-riders int32) + (rider collide-sticky-rider 1 :inline)) (:methods - (new (symbol type int) _type_) - (add-rider! (_type_ process-drawable) collide-sticky-rider) - (reset! (_type_) int) - ) - ) - + (new (symbol type int) _type_) + (add-rider! (_type_ process-drawable) collide-sticky-rider) + (reset! (_type_) int))) (defmethod reset! ((this collide-sticky-rider-group)) "Reset all active riders" (set! (-> this num-riders) 0) - 0 - ) + 0) ;; The rider will be pulled along by the object. ;; This includes possibly rotating the rider (if the platform spins, it spins Jak too). (deftype pull-rider-info (structure) - ((rider collide-sticky-rider) - (rider-cshape collide-shape-moving) - (rider-delta-ry float) - (rider-dest vector :inline) - ) - ) - + ((rider collide-sticky-rider) + (rider-cshape collide-shape-moving) + (rider-delta-ry float) + (rider-dest vector :inline))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collision Result @@ -161,37 +143,29 @@ ;; this computes a "move-vec" and "u". If you move along "move-vec" by "u", you will move out of collsion. ;; It also tells you which primitives are colliding. (deftype collide-shape-intersect (basic) - ((move-vec vector :inline) - (best-u float) - (best-tri collide-tri-result :inline) - (best-from-prim collide-shape-prim) - (best-to-prim collide-shape-prim) - ) + ((move-vec vector :inline) + (best-u float) + (best-tri collide-tri-result :inline) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim)) (:methods - (init! (_type_ vector) symbol) - ) - ) + (init! (_type_ vector) symbol))) ;; Collision with just overlap distance, no vector. (deftype collide-overlap-result (structure) - ((best-dist float) - (best-from-prim collide-shape-prim) - (best-to-prim collide-shape-prim) - (best-from-tri collide-tri-result :inline) - ) + ((best-dist float) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim) + (best-from-tri collide-tri-result :inline)) (:methods - (reset! (_type_) none) - ) - ) - + (reset! (_type_) none))) (defmethod reset! ((this collide-overlap-result)) "Reset the result." (set! (-> this best-dist) 0.0) (set! (-> this best-from-prim) #f) (set! (-> this best-to-prim) #f) - (none) - ) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Touching System @@ -201,24 +175,24 @@ ;; but this isn't well understood yet (deftype overlaps-others-params (structure) - ((options uint32) - (tlist touching-list) - ) - ) + ((options uint32) + (tlist touching-list))) ;; The engine system is used to link collision checks with processes. ;; This allows you to have lists of processes where the process will remove itself when it dies. (define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 768)) + (define *collide-usually-hit-by-player-list* (new 'global 'engine 'collide-usually-hit-by-player-list 256)) + (define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 96)) + (define *collide-player-list* (new 'global 'engine 'collide-player-list 32)) (defenum collide-list-enum (hit-by-player) (usually-hit-by-player) (hit-by-others) - (player) - ) + (player)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collision Primitive Base @@ -226,7 +200,6 @@ ;; These are the settings that can be set per primitive. - (defenum collide-kind :type uint64 :bitfield #t @@ -293,29 +266,28 @@ (unknown-60 60) (unknown-61 61) (unknown-62 62) - (unknown-63 63) - ) + (unknown-63 63)) (defenum collide-action :type uint32 :bitfield #t - (solid 0) ;; used for solid things - (rider-plat-sticky 1) ;; used for platforms in rider/platform interactions - (rider-target 2) ;; used for target in rider/platform interactions - (edgegrab-active 3) ;; set/cleared when entering/exiting edgegrab states - (rider-plat 4) ;; used for platforms in rider/platform interactions - (unused 5) ;; totally unused? - (edgegrab-possible 6) ;; used when edge grab checks should be done - (edgegrab-cam 7) ;; set/cleared when entering/exiting edgegrab states - (swingpole-active 8) ;; set/cleared when entering/exiting swingpole states - (racer 9) ;; set/cleared when entering/exiting racer states - (attackable 10) ;; used for something to do with attacking/damaging + (solid 0) ;; used for solid things + (rider-plat-sticky 1) ;; used for platforms in rider/platform interactions + (rider-target 2) ;; used for target in rider/platform interactions + (edgegrab-active 3) ;; set/cleared when entering/exiting edgegrab states + (rider-plat 4) ;; used for platforms in rider/platform interactions + (unused 5) ;; totally unused? + (edgegrab-possible 6) ;; used when edge grab checks should be done + (edgegrab-cam 7) ;; set/cleared when entering/exiting edgegrab states + (swingpole-active 8) ;; set/cleared when entering/exiting swingpole states + (racer 9) ;; set/cleared when entering/exiting racer states + (attackable 10) ;; used for something to do with attacking/damaging (attackable-unused 11) ;; seems to relate to attacking - set in several places but never tested for? - (snowball 12) ;; set/cleared when entering/exiting snowball states - (tube 13) ;; set/cleared when entering/exiting tube states - (flut 14) ;; set/cleared when entering/exiting flutflut states - (racer-grounded 15) ;; set/cleared when entering/exiting certain racer states w/ extra conditions - (racer-unused 16) ;; seems to relate to racer - never set, only cleared in one place? + (snowball 12) ;; set/cleared when entering/exiting snowball states + (tube 13) ;; set/cleared when entering/exiting tube states + (flut 14) ;; set/cleared when entering/exiting flutflut states + (racer-grounded 15) ;; set/cleared when entering/exiting certain racer states w/ extra conditions + (racer-unused 16) ;; seems to relate to racer - never set, only cleared in one place? ) ;; this field is a bit confusing. you have to have a higher offense to win against an object. @@ -325,70 +297,67 @@ (defenum collide-offense :type int8 (no-offense 0) - (touch 1) ;; just have to touch - (normal-attack 2) ;; any attack (like a normal crate) - (strong-attack 3) ;; hit with zoomer, slide, ground pound/flop, flut attack - (indestructible 4) ;; can't attack it. + (touch 1) ;; just have to touch + (normal-attack 2) ;; any attack (like a normal crate) + (strong-attack 3) ;; hit with zoomer, slide, ground pound/flop, flut attack + (indestructible 4) ;; can't attack it. ) - ;; Every primitive has a prim-core. ;; this is a 32-byte chunk of data that can be pulled out an put in collide caches ;; it stores the transformed world sphere and the collision settings (deftype collide-prim-core (structure) - ((world-sphere vector :inline) - (collide-as collide-kind) - (action collide-action) - (offense collide-offense) - (prim-type int8) - (extra uint8 2) - (quad uint128 2 :overlay-at (-> world-sphere quad)) - ) - ) + ((world-sphere vector :inline) + (collide-as collide-kind) + (action collide-action) + (offense collide-offense) + (prim-type int8) + (extra uint8 2) + (quad uint128 2 :overlay-at (-> world-sphere quad)))) (declare-type collide-shape basic) + (declare-type collide-cache-prim structure) + (declare-type collide-shape-prim-group basic) + (declare-type collide-cache basic) ;; the base class for collision shapes. (deftype collide-shape-prim (basic) - ((cshape collide-shape) - (prim-id uint32) - (transform-index int8) - (prim-core collide-prim-core :inline) - (local-sphere vector :inline) - (collide-with collide-kind) - (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) - (collide-as collide-kind :overlay-at (-> prim-core collide-as)) - (action collide-action :overlay-at (-> prim-core action)) - (offense collide-offense :overlay-at (-> prim-core offense)) - (prim-type int8 :overlay-at (-> prim-core prim-type)) - (radius meters :overlay-at (-> local-sphere w)) - ) + ((cshape collide-shape) + (prim-id uint32) + (transform-index int8) + (prim-core collide-prim-core :inline) + (local-sphere vector :inline) + (collide-with collide-kind) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-kind :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (offense collide-offense :overlay-at (-> prim-core offense)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) + (radius meters :overlay-at (-> local-sphere w))) (:methods - (new (symbol type collide-shape uint int) _type_) - (move-by-vector! (_type_ vector) none) - (find-prim-by-id (_type_ uint) collide-shape-prim) - (debug-draw-world-sphere (_type_) symbol) - (add-fg-prim-using-box (_type_ collide-cache) none) - (add-fg-prim-using-line-sphere (_type_ collide-cache) none) - (add-fg-prim-using-y-probe (_type_ collide-cache) none) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) - (unused-17 () none) - (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none) - (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none) - (add-to-bounding-box (_type_ collide-kind) symbol) - (num-mesh (_type_ collide-shape-prim) int) - (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none) - (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none) - (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none) - (update-transforms! (_type_ process-drawable) symbol) - (set-collide-as! (_type_ collide-kind) none) - (set-collide-with! (_type_ collide-kind) none) - ) - ) + (new (symbol type collide-shape uint int) _type_) + (move-by-vector! (_type_ vector) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (debug-draw-world-sphere (_type_) symbol) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache) none) + (add-fg-prim-using-y-probe (_type_ collide-cache) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (unused-17 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none) + (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none) + (add-to-bounding-box (_type_ collide-kind) symbol) + (num-mesh (_type_ collide-shape-prim) int) + (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none) + (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none) + (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none) + (update-transforms! (_type_ process-drawable) symbol) + (set-collide-as! (_type_ collide-kind) none) + (set-collide-with! (_type_ collide-kind) none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Specific Collision Implementation @@ -402,43 +371,34 @@ ;; the pat is stored directly here. ;; I believe the "local sphere" is used as the sphere. (deftype collide-shape-prim-sphere (collide-shape-prim) - ((pat pat-surface) - ) + ((pat pat-surface)) (:methods - (new (symbol type collide-shape uint) _type_) - ) - ) + (new (symbol type collide-shape uint) _type_))) ;; mesh collision ;; the pats are stored per tri in the mesh. ;; These meshes interact with a cache automatically (a specific collide-shape-prim-mesh cache, not the ;; more general collide-cache) (deftype collide-shape-prim-mesh (collide-shape-prim) - ((mesh collide-mesh) - (mesh-id int32) - (mesh-cache-id uint64) - (mesh-cache-tris (inline-array collide-mesh-cache-tri)) - ) + ((mesh collide-mesh) + (mesh-id int32) + (mesh-cache-id uint64) + (mesh-cache-tris (inline-array collide-mesh-cache-tri))) (:methods - (new (symbol type collide-shape uint uint) _type_) - (change-mesh (_type_ int) none) - ) - ) + (new (symbol type collide-shape uint uint) _type_) + (change-mesh (_type_ int) none))) ;; A group of collide-shape-prim's (deftype collide-shape-prim-group (collide-shape-prim) - ((num-prims int32) - (num-prims-u uint32 :overlay-at num-prims) - (allocated-prims int32) - (prim collide-shape-prim 1) - (prims collide-shape-prim :dynamic :overlay-at (-> prim 0)) - ) + ((num-prims int32) + (num-prims-u uint32 :overlay-at num-prims) + (allocated-prims int32) + (prim collide-shape-prim 1) + (prims collide-shape-prim :dynamic :overlay-at (-> prim 0))) (:methods - (new (symbol type collide-shape uint int) _type_) - (append-prim (_type_ collide-shape-prim) none) - (add-to-non-empty-bounding-box (_type_ collide-kind) none) - ) - ) + (new (symbol type collide-shape uint int) _type_) + (append-prim (_type_ collide-shape-prim) none) + (add-to-non-empty-bounding-box (_type_ collide-kind) none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Collide Shape @@ -452,6 +412,7 @@ ;; - riders (declare-type collide-work structure) + (declare-type touching-shapes-entry structure) (defenum nav-flags @@ -464,55 +425,51 @@ (navf4 4) (navf5 5) (navf6 6) - (navf7 7) - ) + (navf7 7)) ;; we're a child of trsqv, so we store a full transform + derivative. (deftype collide-shape (trsqv) - ((process process-drawable) - (max-iteration-count uint8) - (nav-flags nav-flags) - (pad-byte uint8 2) - (pat-ignore-mask pat-surface) - (event-self symbol) - (event-other symbol) - (root-prim collide-shape-prim) - (riders collide-sticky-rider-group) - (backup-collide-as collide-kind) - (backup-collide-with collide-kind) - ) + ((process process-drawable) + (max-iteration-count uint8) + (nav-flags nav-flags) + (pad-byte uint8 2) + (pat-ignore-mask pat-surface) + (event-self symbol) + (event-other symbol) + (root-prim collide-shape-prim) + (riders collide-sticky-rider-group) + (backup-collide-as collide-kind) + (backup-collide-with collide-kind)) (:methods - (new (symbol type process-drawable collide-list-enum) _type_) - (move-by-vector! (_type_ vector) none) - (alloc-riders (_type_ int) none) - (move-to-point! (_type_ vector) none) - (debug-draw (_type_) none) - (fill-cache-for-shape! (_type_ float collide-kind) none) - (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none) - (find-prim-by-id (_type_ uint) collide-shape-prim) - (detect-riders! (_type_) symbol) - (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol) - (integrate-and-collide! (_type_ vector) none) - (find-collision-meshes (_type_) symbol) - (on-platform (_type_ collide-shape collide-overlap-result) symbol) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol) - (calc-shove-up (_type_ attack-info float) vector) - (should-push-away (_type_ collide-shape collide-overlap-result) symbol) - (pull-rider! (_type_ pull-rider-info) none) - (pull-riders! (_type_) symbol) - (do-push-aways! (_type_) symbol) - (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim) - (update-transforms! (_type_) symbol) - (clear-collide-with-as (_type_) none) - (restore-collide-with-as (_type_) none) - (backup-collide-with-as (_type_) none) - (set-root-prim-collide-with! (_type_ collide-kind) none) - (set-root-prim-collide-as! (_type_ collide-kind) none) - (set-collide-kinds (_type_ int collide-kind collide-kind) none) - (set-collide-offense (_type_ int collide-offense) none) - (send-shove-back (_type_ process touching-shapes-entry float float float) none) - ) - ) + (new (symbol type process-drawable collide-list-enum) _type_) + (move-by-vector! (_type_ vector) none) + (alloc-riders (_type_ int) none) + (move-to-point! (_type_ vector) none) + (debug-draw (_type_) none) + (fill-cache-for-shape! (_type_ float collide-kind) none) + (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (detect-riders! (_type_) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol) + (integrate-and-collide! (_type_ vector) none) + (find-collision-meshes (_type_) symbol) + (on-platform (_type_ collide-shape collide-overlap-result) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (calc-shove-up (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-overlap-result) symbol) + (pull-rider! (_type_ pull-rider-info) none) + (pull-riders! (_type_) symbol) + (do-push-aways! (_type_) symbol) + (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim) + (update-transforms! (_type_) symbol) + (clear-collide-with-as (_type_) none) + (restore-collide-with-as (_type_) none) + (backup-collide-with-as (_type_) none) + (set-root-prim-collide-with! (_type_ collide-kind) none) + (set-root-prim-collide-as! (_type_ collide-kind) none) + (set-collide-kinds (_type_ int collide-kind collide-kind) none) + (set-collide-offense (_type_ int collide-offense) none) + (send-shove-back (_type_ process touching-shapes-entry float float float) none))) (defenum cshape-moving-flags :bitfield #t @@ -546,8 +503,7 @@ (csmf26) (csmf27) (csmf28) - (csmf29) - ) + (csmf29)) (defenum cshape-reaction-flags :bitfield #t @@ -583,49 +539,45 @@ (csrf28) (csrf29) (csrf30) - (csrf31) - ) + (csrf31)) ;; A collide-shape for independently moving objects (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame) - (rider-last-move vector :inline) - (trans-old vector 3 :inline) - (poly-pat pat-surface) - (cur-pat pat-surface) - (ground-pat pat-surface) - (status cshape-moving-flags) - (old-status cshape-moving-flags) - (prev-status cshape-moving-flags) - (reaction-flag cshape-reaction-flags) - (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) - (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none)) - (local-normal vector :inline) - (surface-normal vector :inline) - (poly-normal vector :inline) - (ground-poly-normal vector :inline) - (ground-touch-point vector :inline) - (shadow-pos vector :inline) - (ground-impact-vel meters) - (surface-angle float) - (poly-angle float) - (touch-angle float) - (coverage float) - (dynam dynamics) - (surf surface) - ) + ((rider-time time-frame) + (rider-last-move vector :inline) + (trans-old vector 3 :inline) + (poly-pat pat-surface) + (cur-pat pat-surface) + (ground-pat pat-surface) + (status cshape-moving-flags) + (old-status cshape-moving-flags) + (prev-status cshape-moving-flags) + (reaction-flag cshape-reaction-flags) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) + (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none)) + (local-normal vector :inline) + (surface-normal vector :inline) + (poly-normal vector :inline) + (ground-poly-normal vector :inline) + (ground-touch-point vector :inline) + (shadow-pos vector :inline) + (ground-impact-vel meters) + (surface-angle float) + (poly-angle float) + (touch-angle float) + (coverage float) + (dynam dynamics) + (surf surface)) (:methods - (set-and-handle-pat! (_type_ pat-surface) none) - (integrate-no-collide! (_type_ vector) none) - (collide-shape-moving-method-58 (_type_ vector) symbol) - (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none) - (move-to-ground (_type_ float float symbol collide-kind) symbol) - (move-to-ground-point! (_type_ vector vector vector) none) - (compute-acc-due-to-gravity (_type_ vector float) vector) - (step-collison! (_type_ vector vector float) float) - (move-to-tri! (_type_ collide-tri-result vector) none) - ) - ) + (set-and-handle-pat! (_type_ pat-surface) none) + (integrate-no-collide! (_type_ vector) none) + (collide-shape-moving-method-58 (_type_ vector) symbol) + (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none) + (move-to-ground (_type_ float float symbol collide-kind) symbol) + (move-to-ground-point! (_type_ vector vector vector) none) + (compute-acc-due-to-gravity (_type_ vector float) vector) + (step-collison! (_type_ vector vector float) float) + (move-to-tri! (_type_ collide-tri-result vector) none))) ;;;;;;;;;;;;;;;;;;;; ;; Basic Methods @@ -641,61 +593,53 @@ (set! (-> v0-0 transform-index) -2) (set! (-> v0-0 prim-core offense) (collide-offense no-offense)) (set! (-> v0-0 prim-core prim-type) -2) - v0-0 - ) - ) + v0-0)) (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint)) "Allocate a new sphere primitive" - - (let ((this (the collide-shape-prim-sphere ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-sphere))))) - (set! (-> this pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) - (set! (-> this prim-core prim-type) -1) - this - ) - ) + (let ((this (the collide-shape-prim-sphere + ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-sphere))))) + (set! (-> this pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) + (set! (-> this prim-core prim-type) -1) + this)) (defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (cshape collide-shape) (mesh-id uint) (prim-id uint)) "Allocate a new mesh primitive" - - (let ((this (the collide-shape-prim-mesh ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh))))) + (let ((this (the collide-shape-prim-mesh + ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh))))) (set! (-> this mesh) #f) (set! (-> this mesh-id) (the-as int mesh-id)) (set! (-> this mesh-cache-id) (the-as uint 0)) (set! (-> this prim-core prim-type) 1) - (the-as collide-shape-prim-mesh this) - ) - ) + (the-as collide-shape-prim-mesh this))) (defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (cshape collide-shape) (elt-count uint) (prim-id int)) "Allocate a group of primitives." - - (let ((this (the collide-shape-prim-group ((method-of-type collide-shape-prim new) allocation type-to-make cshape (the uint prim-id) (the int (+ (-> type-to-make size) (* (+ elt-count -1) 4))))))) + (let ((this (the collide-shape-prim-group + ((method-of-type collide-shape-prim new) allocation + type-to-make + cshape + (the uint prim-id) + (the int (+ (-> type-to-make size) (* (+ elt-count -1) 4))))))) (set! (-> this allocated-prims) (the int elt-count)) (set! (-> this num-prims) 0) (set! (-> this prim-core prim-type) 0) (while (nonzero? elt-count) (+! elt-count -1) (set! (-> this prim elt-count) (the collide-shape-prim #f)) - (nop!) - ) - this - ) - ) + (nop!)) + this)) (defmethod length ((this collide-shape-prim-group)) "How many primitives are used?" - (-> this num-prims) - ) + (-> this num-prims)) (defmethod asize-of ((this collide-shape-prim-group)) "How big is this in memory?" - (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4))) - ) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4)))) (defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process-drawable) (collide-list-kind collide-list-enum)) "Allocate a new collide-shape and add to a collide-list" - (let ((this (object-new allocation type-to-make (the int (-> type-to-make size))))) (set! (-> this process) proc) (set! (-> this max-iteration-count) 1) @@ -704,84 +648,73 @@ (set! (-> this event-other) #f) (set! (-> this riders) #f) (set! (-> this root-prim) #f) - (case (-> proc type symbol) - (('camera) - (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) - ) - (else - (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) - ) - ) + (('camera) (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1))) + (else (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)))) ;; reset transformation to the origin. (set! (-> this trans w) 1.0) (quaternion-identity! (-> this quat)) (vector-identity! (-> this scale)) - ;; add us to right list. (case collide-list-kind - (((collide-list-enum hit-by-player)) - (add-connection *collide-hit-by-player-list* proc #f this #f #f)) - - (((collide-list-enum usually-hit-by-player)) - (add-connection *collide-usually-hit-by-player-list* proc #f this #f #f)) - - (((collide-list-enum hit-by-others)) - (add-connection *collide-hit-by-others-list* proc #f this #f #f)) - - (((collide-list-enum player)) - (add-connection *collide-player-list* proc #f this #f #f)) - - (else - (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") - ) - ) - this - ) - ) + (((collide-list-enum hit-by-player)) (add-connection *collide-hit-by-player-list* proc #f this #f #f)) + (((collide-list-enum usually-hit-by-player)) (add-connection *collide-usually-hit-by-player-list* proc #f this #f #f)) + (((collide-list-enum hit-by-others)) (add-connection *collide-hit-by-others-list* proc #f this #f #f)) + (((collide-list-enum player)) (add-connection *collide-player-list* proc #f this #f #f)) + (else (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%"))) + this)) (defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (riders-amount int)) "Allocate a new collide-sticky-rider-group with space for riders-amount sticky riders." - - (let ((this (object-new allocation type-to-make (the int (+ (-> type-to-make size) (the uint (* (1- riders-amount) (size-of collide-sticky-rider)))))))) - (set! (-> this allocated-riders) riders-amount) - (set! (-> this num-riders) 0) - this - ) - ) + (let ((this (object-new allocation + type-to-make + (the int (+ (-> type-to-make size) (the uint (* (1 - riders-amount) (size-of collide-sticky-rider)))))))) + (set! (-> this allocated-riders) riders-amount) + (set! (-> this num-riders) 0) + this)) (defmethod length ((this collide-sticky-rider-group)) - (-> this num-riders) - ) + (-> this num-riders)) (defmethod asize-of ((this collide-sticky-rider-group)) - (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32))) - ) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32)))) -(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh - :cshape #f - :prim-core (new 'static 'collide-prim-core - :world-sphere (new 'static 'vector :w 204800000.0) - :collide-as (collide-kind background) - :action (collide-action solid) - :offense (collide-offense indestructible) - :prim-type 2 - ) - :local-sphere (new 'static 'vector :w 204800000.0) - :mesh #f - ) - ) +(define *collide-shape-prim-backgnd* + (new 'static + 'collide-shape-prim-mesh + :cshape #f + :prim-core + (new 'static + 'collide-prim-core + :world-sphere + (new 'static 'vector :w 204800000.0) + :collide-as + (collide-kind background) + :action + (collide-action solid) + :offense + (collide-offense indestructible) + :prim-type 2) + :local-sphere + (new 'static 'vector :w 204800000.0) + :mesh #f)) -(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh - :cshape #f - :prim-core (new 'static 'collide-prim-core - :world-sphere (new 'static 'vector :w 204800000.0) - :collide-as (collide-kind water) - :action (collide-action solid) - :offense (collide-offense indestructible) - :prim-type 2 - ) - :local-sphere (new 'static 'vector :w 204800000.0) - :mesh #f - ) - ) +(define *collide-shape-prim-water* + (new 'static + 'collide-shape-prim-mesh + :cshape #f + :prim-core + (new 'static + 'collide-prim-core + :world-sphere + (new 'static 'vector :w 204800000.0) + :collide-as + (collide-kind water) + :action + (collide-action solid) + :offense + (collide-offense indestructible) + :prim-type 2) + :local-sphere + (new 'static 'vector :w 204800000.0) + :mesh #f)) diff --git a/goal_src/jak1/engine/collide/collide-shape-rider.gc b/goal_src/jak1/engine/collide/collide-shape-rider.gc index 40a9218aef..7a66269f6e 100644 --- a/goal_src/jak1/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak1/engine/collide/collide-shape-rider.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/collide-shape.gc") ;; name: collide-shape-rider.gc @@ -12,40 +11,22 @@ (defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) "Are we on the platform? Returns #t/#f and also sets an overlap result." - (let ((v1-0 arg1)) - (set! (-> v1-0 best-dist) 0.0) - (set! (-> v1-0 best-from-prim) #f) - (set! (-> v1-0 best-to-prim) #f) - ) + (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-from-prim) #f) (set! (-> v1-0 best-to-prim) #f)) (set! (-> arg1 best-dist) 122.88) (let ((s5-0 (-> this root-prim)) - (s4-0 (-> arg0 root-prim)) - ) + (s4-0 (-> arg0 root-prim))) (when (and (logtest? (-> s5-0 collide-with) (-> s4-0 prim-core collide-as)) (logtest? (-> s5-0 prim-core action) (collide-action rider-plat-sticky)) - (logtest? (-> s4-0 prim-core action) (collide-action rider-target)) - ) + (logtest? (-> s4-0 prim-core action) (collide-action rider-target))) (let ((f0-4 (- (- (vector-vector-distance (the-as vector (-> s5-0 prim-core)) (the-as vector (-> s4-0 prim-core))) - (-> s5-0 prim-core world-sphere w) - ) - (-> s4-0 prim-core world-sphere w) - ) - ) - ) - (if (< f0-4 122.88) - (on-platform-test s5-0 s4-0 arg1 f0-4) - ) - ) - ) - ) - (< (-> arg1 best-dist) 122.88) - ) - + (-> s5-0 prim-core world-sphere w)) + (-> s4-0 prim-core world-sphere w)))) + (if (< f0-4 122.88) (on-platform-test s5-0 s4-0 arg1 f0-4))))) + (< (-> arg1 best-dist) 122.88)) (defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") - (none) - ) + (none)) (defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "Check if we're on the platform for a prim group." @@ -53,108 +34,60 @@ (dotimes (s2-0 (-> this num-prims)) (let ((s1-0 (-> this prims s2-0))) ;; check collide kind - (when (and (logtest? (-> s1-0 collide-with) s3-0) - (logtest? (-> s1-0 prim-core action) (collide-action rider-plat-sticky)) - ) + (when (and (logtest? (-> s1-0 collide-with) s3-0) (logtest? (-> s1-0 prim-core action) (collide-action rider-plat-sticky))) ;; check dist (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> s1-0 prim-core)) (the-as vector (-> arg0 prim-core))) - (-> s1-0 prim-core world-sphere w) - ) - (-> arg0 prim-core world-sphere w) - ) - ) - ) + (-> s1-0 prim-core world-sphere w)) + (-> arg0 prim-core world-sphere w)))) ;; dist close enough, check! - (if (< f0-2 122.88) - (on-platform-test s1-0 arg0 arg1 f0-2) - ) - ) - ) - ) - ) - ) - (none) - ) + (if (< f0-2 122.88) (on-platform-test s1-0 arg0 arg1 f0-2))))))) + (none)) (defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "check if we're on the platform for a mesh." (case (-> arg0 type) - ;; mesh to group - ((collide-shape-prim-group) - (let ((s3-0 (-> this collide-with))) - (dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims)) - (let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0))) - (when (and (logtest? s3-0 (-> s1-0 prim-core collide-as)) - (logtest? (-> s1-0 prim-core action) (collide-action rider-target)) - ) - (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s1-0 prim-core))) - (-> this prim-core world-sphere w) - ) - (-> s1-0 prim-core world-sphere w) - ) - ) - ) - (if (< f0-2 122.88) - (on-platform-test this s1-0 arg1 f0-2) - ) - ) - ) - ) - ) - ) - ) - ;; mesh to sphere. use the collide-mesh-cache. - ((collide-shape-prim-sphere) - (let ((s3-1 (-> this mesh))) - (when s3-1 - (let ((s2-1 *collide-mesh-cache*)) - (when (!= (-> this mesh-cache-id) (-> s2-1 id)) - (let ((v1-17 (allocate! s2-1 (* 96 (-> s3-1 num-tris))))) - (cond - (v1-17 - (set! (-> this mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) - (set! (-> this mesh-cache-id) (-> s2-1 id)) - (populate-cache! - s3-1 - (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) - (-> this cshape process node-list data (-> this transform-index) bone transform) - ) - ) - (else - (return #f) - ) - ) - ) - ) - ) - (let* ((s2-2 (new 'stack-no-clear 'collide-tri-result)) - (f0-4 (sphere-on-platform-test - s3-1 - (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) - s2-2 - (the-as vector (-> arg0 prim-core)) - (-> arg1 best-dist) - ) - ) - ) - (when (< f0-4 (-> arg1 best-dist)) - (set! (-> arg1 best-dist) f0-4) - (set! (-> arg1 best-from-prim) this) - (set! (-> arg1 best-to-prim) arg0) - (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad)) - (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad)) - (set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-2 vertex 2 quad)) - (set! (-> arg1 best-from-tri intersect quad) (-> s2-2 intersect quad)) - (set! (-> arg1 best-from-tri normal quad) (-> s2-2 normal quad)) - (set! (-> arg1 best-from-tri pat) (-> s2-2 pat)) - ) - ) - ) - ) - ) - ) - (none) - ) + ;; mesh to group + ((collide-shape-prim-group) + (let ((s3-0 (-> this collide-with))) + (dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims)) + (let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0))) + (when (and (logtest? s3-0 (-> s1-0 prim-core collide-as)) (logtest? (-> s1-0 prim-core action) (collide-action rider-target))) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s1-0 prim-core))) + (-> this prim-core world-sphere w)) + (-> s1-0 prim-core world-sphere w)))) + (if (< f0-2 122.88) (on-platform-test this s1-0 arg1 f0-2)))))))) + ;; mesh to sphere. use the collide-mesh-cache. + ((collide-shape-prim-sphere) + (let ((s3-1 (-> this mesh))) + (when s3-1 + (let ((s2-1 *collide-mesh-cache*)) + (when (!= (-> this mesh-cache-id) (-> s2-1 id)) + (let ((v1-17 (allocate! s2-1 (* 96 (-> s3-1 num-tris))))) + (cond + (v1-17 + (set! (-> this mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) + (set! (-> this mesh-cache-id) (-> s2-1 id)) + (populate-cache! s3-1 + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) + (-> this cshape process node-list data (-> this transform-index) bone transform))) + (else (return #f)))))) + (let* ((s2-2 (new 'stack-no-clear 'collide-tri-result)) + (f0-4 (sphere-on-platform-test s3-1 + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) + s2-2 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist)))) + (when (< f0-4 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-4) + (set! (-> arg1 best-from-prim) this) + (set! (-> arg1 best-to-prim) arg0) + (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad)) + (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad)) + (set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-2 vertex 2 quad)) + (set! (-> arg1 best-from-tri intersect quad) (-> s2-2 intersect quad)) + (set! (-> arg1 best-from-tri normal quad) (-> s2-2 normal quad)) + (set! (-> arg1 best-from-tri pat) (-> s2-2 pat)))))))) + (none)) (defmethod add-rider! ((this collide-sticky-rider-group) (arg0 process-drawable)) "Add a rider to this platform." @@ -163,33 +96,21 @@ ((< (-> this num-riders) (-> this allocated-riders)) (set! gp-0 (-> this rider (-> this num-riders))) (+! (-> this num-riders) 1) - (let ((v1-6 gp-0)) - (set! (-> v1-6 rider-handle) (the-as handle arg0)) - (set! (-> v1-6 sticky-prim) #f) - ) - ) - (else - (format 0 "ERROR: Exeeded max number of riders!~%") - ) - ) - gp-0 - ) - ) + (let ((v1-6 gp-0)) (set! (-> v1-6 rider-handle) (the-as handle arg0)) (set! (-> v1-6 sticky-prim) #f))) + (else (format 0 "ERROR: Exeeded max number of riders!~%"))) + gp-0)) (defmethod detect-riders! ((this collide-shape)) "See who is riding us." (let ((s5-0 (-> this riders))) (when s5-0 (let* ((v1-0 *collide-mesh-cache*) - (a0-1 (-> v1-0 id)) - ) + (a0-1 (-> v1-0 id))) (set! (-> v1-0 used-size) (the-as uint 0)) (let ((a0-2 (the-as int (+ a0-1 1)))) (b! (zero? (the-as uint a0-2)) cfg-3 :likely-delay (set! a0-2 1)) (label cfg-3) - (set! (-> v1-0 id) (the-as uint a0-2)) - ) - ) + (set! (-> v1-0 id) (the-as uint a0-2)))) (set! (-> s5-0 num-riders) 0) 0 (let ((s4-0 (-> this root-prim collide-with))) @@ -199,46 +120,26 @@ (let ((s3-0 (-> v1-7 next0))) (while (!= v1-7 (-> *collide-player-list* alive-list-end)) (let* ((s2-0 (-> (the-as connection v1-7) param1)) - (v1-8 (-> (the-as collide-shape s2-0) root-prim)) - ) + (v1-8 (-> (the-as collide-shape s2-0) root-prim))) (when (logtest? s4-0 (-> v1-8 prim-core collide-as)) (when (and (logtest? (-> v1-8 prim-core action) (collide-action rider-target)) - (!= (-> this process) (-> (the-as collide-shape s2-0) process)) - ) + (!= (-> this process) (-> (the-as collide-shape s2-0) process))) (let ((s1-0 (new 'stack-no-clear 'collide-overlap-result))) (when (on-platform this (the-as collide-shape s2-0) s1-0) - (let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process))))) - ) + (let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process)))))) (when s4-1 (let ((a0-11 (-> s1-0 best-from-prim))) (set! (-> s4-1 sticky-prim) a0-11) - (let ((s1-1 - (-> (the-as process-drawable (-> this process)) node-list data (-> a0-11 transform-index) bone transform) - ) - ) + (let ((s1-1 (-> (the-as process-drawable (-> this process)) node-list data (-> a0-11 transform-index) bone transform))) (set! (-> s4-1 prim-ry) (matrix-y-angle s1-1)) (let ((s0-0 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-0 s1-1) - (vector-matrix*! (-> s4-1 rider-local-pos) (-> (the-as collide-shape s2-0) trans) s0-0) - ) - ) - ) - (send-event (-> this process) 'ridden s4-1) - ) - ) - (set! s4-0 (-> this root-prim collide-with)) - ) - ) - ) - ) - ) + (vector-matrix*! (-> s4-1 rider-local-pos) (-> (the-as collide-shape s2-0) trans) s0-0)))) + (send-event (-> this process) 'ridden s4-1))) + (set! s4-0 (-> this root-prim collide-with))))))) (set! v1-7 s3-0) *collide-player-list* - (set! s3-0 (-> s3-0 next0)) - ) - ) - ) - ) + (set! s3-0 (-> s3-0 next0)))))) (when (logtest? s4-0 (collide-kind cak-1 cak-2 cak-3)) (when (logtest? s4-0 (collide-kind cak-1)) (let ((v1-37 (-> *collide-hit-by-player-list* alive-list next0))) @@ -246,16 +147,13 @@ (let ((s3-1 (-> v1-37 next0))) (while (!= v1-37 (-> *collide-hit-by-player-list* alive-list-end)) (let* ((s2-1 (-> (the-as connection v1-37) param1)) - (v1-38 (-> (the-as collide-shape s2-1) root-prim)) - ) + (v1-38 (-> (the-as collide-shape s2-1) root-prim))) (when (logtest? s4-0 (-> v1-38 prim-core collide-as)) (when (and (logtest? (-> v1-38 prim-core action) (collide-action rider-target)) - (!= (-> this process) (-> (the-as collide-shape s2-1) process)) - ) + (!= (-> this process) (-> (the-as collide-shape s2-1) process))) (let ((s1-2 (new 'stack-no-clear 'collide-overlap-result))) (when (on-platform this (the-as collide-shape s2-1) s1-2) - (let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process))))) - ) + (let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process)))))) (when s4-2 (let ((a0-30 (-> s1-2 best-from-prim))) (set! (-> s4-2 sticky-prim) a0-30) @@ -263,42 +161,25 @@ (set! (-> s4-2 prim-ry) (matrix-y-angle s1-3)) (let ((s0-1 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-1 s1-3) - (vector-matrix*! (-> s4-2 rider-local-pos) (-> (the-as collide-shape s2-1) trans) s0-1) - ) - ) - ) - (send-event (-> this process) 'ridden s4-2) - ) - ) - (set! s4-0 (-> this root-prim collide-with)) - ) - ) - ) - ) - ) + (vector-matrix*! (-> s4-2 rider-local-pos) (-> (the-as collide-shape s2-1) trans) s0-1)))) + (send-event (-> this process) 'ridden s4-2))) + (set! s4-0 (-> this root-prim collide-with))))))) (set! v1-37 s3-1) *collide-hit-by-player-list* - (set! s3-1 (-> s3-1 next0)) - ) - ) - ) - ) + (set! s3-1 (-> s3-1 next0)))))) (when (logtest? s4-0 (collide-kind cak-2)) (let ((v1-66 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((s3-2 (-> v1-66 next0))) (while (!= v1-66 (-> *collide-usually-hit-by-player-list* alive-list-end)) (let* ((s2-2 (-> (the-as connection v1-66) param1)) - (v1-67 (-> (the-as collide-shape s2-2) root-prim)) - ) + (v1-67 (-> (the-as collide-shape s2-2) root-prim))) (when (logtest? s4-0 (-> v1-67 prim-core collide-as)) (when (and (logtest? (-> v1-67 prim-core action) (collide-action rider-target)) - (!= (-> this process) (-> (the-as collide-shape s2-2) process)) - ) + (!= (-> this process) (-> (the-as collide-shape s2-2) process))) (let ((s1-4 (new 'stack-no-clear 'collide-overlap-result))) (when (on-platform this (the-as collide-shape s2-2) s1-4) - (let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process))))) - ) + (let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process)))))) (when s4-3 (let ((a0-49 (-> s1-4 best-from-prim))) (set! (-> s4-3 sticky-prim) a0-49) @@ -306,42 +187,25 @@ (set! (-> s4-3 prim-ry) (matrix-y-angle s1-5)) (let ((s0-2 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-2 s1-5) - (vector-matrix*! (-> s4-3 rider-local-pos) (-> (the-as collide-shape s2-2) trans) s0-2) - ) - ) - ) - (send-event (-> this process) 'ridden s4-3) - ) - ) - (set! s4-0 (-> this root-prim collide-with)) - ) - ) - ) - ) - ) + (vector-matrix*! (-> s4-3 rider-local-pos) (-> (the-as collide-shape s2-2) trans) s0-2)))) + (send-event (-> this process) 'ridden s4-3))) + (set! s4-0 (-> this root-prim collide-with))))))) (set! v1-66 s3-2) *collide-usually-hit-by-player-list* - (set! s3-2 (-> s3-2 next0)) - ) - ) - ) - ) + (set! s3-2 (-> s3-2 next0)))))) (when (logtest? s4-0 (collide-kind cak-3)) (let ((v1-94 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((s3-3 (-> v1-94 next0))) (while (!= v1-94 (-> *collide-hit-by-others-list* alive-list-end)) (let* ((s2-3 (-> (the-as connection v1-94) param1)) - (v1-95 (-> (the-as collide-shape s2-3) root-prim)) - ) + (v1-95 (-> (the-as collide-shape s2-3) root-prim))) (when (logtest? s4-0 (-> v1-95 prim-core collide-as)) (when (and (logtest? (-> v1-95 prim-core action) (collide-action rider-target)) - (!= (-> this process) (-> (the-as collide-shape s2-3) process)) - ) + (!= (-> this process) (-> (the-as collide-shape s2-3) process))) (let ((s1-6 (new 'stack-no-clear 'collide-overlap-result))) (when (on-platform this (the-as collide-shape s2-3) s1-6) - (let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process))))) - ) + (let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process)))))) (when s4-4 (let ((a0-68 (-> s1-6 best-from-prim))) (set! (-> s4-4 sticky-prim) a0-68) @@ -349,32 +213,13 @@ (set! (-> s4-4 prim-ry) (matrix-y-angle s1-7)) (let ((s0-3 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-3 s1-7) - (vector-matrix*! (-> s4-4 rider-local-pos) (-> (the-as collide-shape s2-3) trans) s0-3) - ) - ) - ) - (send-event (-> this process) 'ridden s4-4) - ) - ) - (set! s4-0 (-> this root-prim collide-with)) - ) - ) - ) - ) - ) + (vector-matrix*! (-> s4-4 rider-local-pos) (-> (the-as collide-shape s2-3) trans) s0-3)))) + (send-event (-> this process) 'ridden s4-4))) + (set! s4-0 (-> this root-prim collide-with))))))) (set! v1-94 s3-3) *collide-hit-by-others-list* - (set! s3-3 (-> s3-3 next0)) - ) - ) - ) - #f - ) - ) - ) - ) - ) - ) + (set! s3-3 (-> s3-3 next0))))) + #f)))))) (defmethod pull-riders! ((this collide-shape)) "Move our riders." @@ -383,46 +228,30 @@ (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) (countdown (s3-0 (-> s5-0 num-riders)) (let* ((v1-2 (-> s5-0 rider s3-0)) - (a0-1 (-> v1-2 rider-handle)) - ) + (a0-1 (-> v1-2 rider-handle))) (when (handle->process a0-1) (set! (-> s4-0 rider) v1-2) - (set! (-> s4-0 rider-cshape) - (the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root)) - ) + (set! (-> s4-0 rider-cshape) (the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root))) (let ((a0-5 (-> v1-2 sticky-prim))) (when a0-5 (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) (let ((s1-0 (-> s4-0 rider-dest))) (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) - (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) - ) - (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) - ) - (pull-rider! this s4-0) - ) - ) - ) - ) - ) - ) - #f - ) - ) - ) + (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w)))) + (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry)))) + (pull-rider! this s4-0))))))) + #f))) (defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) "Move a rider." (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) (rlet ((vf0 :class vf) (vf1 :class vf) - (vf2 :class vf) - ) + (vf2 :class vf)) (init-vf0-vector) (let ((gp-0 (-> arg0 rider-cshape))) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (new 'stack-no-clear 'vector)) - ) + (s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> gp-0 trans quad)) (vector-! s3-0 (-> arg0 rider-dest) s4-0) (cond @@ -432,64 +261,33 @@ (let ((s0-0 gp-0)) (set! sv-160 (method-of-object s0-0 fill-cache-for-shape!)) (let ((a1-3 (+ 8192.0 (vector-length s3-0))) - (a2-0 (-> gp-0 root-prim collide-with)) - ) - (sv-160 s0-0 a1-3 a2-0) - ) - ) - (set! (-> this root-prim prim-core collide-as) s1-0) - ) + (a2-0 (-> gp-0 root-prim collide-with))) + (sv-160 s0-0 a1-3 a2-0))) + (set! (-> this root-prim prim-core collide-as) s1-0)) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> s3-0 quad)) (let ((v1-12 s2-1)) (.lvf vf1 (&-> s2-1 quad)) - (let ((f0-2 (-> *display* frames-per-second))) - (.mov at-0 f0-2) - ) + (let ((f0-2 (-> *display* frames-per-second))) (.mov at-0 f0-2)) (.mov vf2 at-0) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-12 quad) vf1) - ) + (.svf (&-> v1-12 quad) vf1)) (cond ((type-type? (-> gp-0 type) collide-shape-moving) - (let ((s3-1 (-> gp-0 status))) - (integrate-and-collide! gp-0 s2-1) - (set! (-> gp-0 status) s3-1) - ) - ) - (else - (integrate-and-collide! gp-0 s2-1) - ) - ) - ) - ) - (else - (move-by-vector! gp-0 s3-0) - ) - ) + (let ((s3-1 (-> gp-0 status))) (integrate-and-collide! gp-0 s2-1) (set! (-> gp-0 status) s3-1))) + (else (integrate-and-collide! gp-0 s2-1))))) + (else (move-by-vector! gp-0 s3-0))) (when (type-type? (-> gp-0 type) collide-shape-moving) (let ((v1-18 (new 'stack-no-clear 'vector))) (vector-! v1-18 (-> gp-0 trans) s4-0) - (vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second)) - ) - (set-time! (-> gp-0 rider-time)) - ) - ) - (let ((f0-4 (-> arg0 rider-delta-ry))) - (if (!= f0-4 0.0) - (send-event (-> gp-0 process) 'rotate-y-angle f0-4) - ) - ) - ) - (none) - ) - ) + (vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second))) + (set-time! (-> gp-0 rider-time)))) + (let ((f0-4 (-> arg0 rider-delta-ry))) (if (!= f0-4 0.0) (send-event (-> gp-0 process) 'rotate-y-angle f0-4)))) + (none))) (defmethod alloc-riders ((this collide-shape) (arg0 int)) (if (-> this riders) - (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") - (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0)) - ) - (none) - ) + (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") + (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0))) + (none)) diff --git a/goal_src/jak1/engine/collide/collide-shape.gc b/goal_src/jak1/engine/collide/collide-shape.gc index 5d4dd7aeda..b48a422d62 100644 --- a/goal_src/jak1/engine/collide/collide-shape.gc +++ b/goal_src/jak1/engine/collide/collide-shape.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/camera/camera-h.gc") (require "engine/geometry/cylinder.gc") (require "engine/collide/collide-target-h.gc") @@ -32,14 +31,12 @@ ;; the collision isn't symmetric [collide(a, b) != collide(b, a)] because the with/as flags. ;; so there's some weirdness to get all the method dispatch stuff to work around (you can only dispatch on one type) - (defmethod should-push-away ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) "Find the overlap between two collide shapes. This is the main entry point for the overlap algorithm. The result is returned in arg1. The obj is collided _with_ arg0 (meaning obj uses its collide-with, arg0 uses colide-as). The best-dist is only valid if the result is #t (it should be negative then)" - - ;; this method begins the recursive traversal through the tree of collide-shape-prims, starting with the - ;; root of each shape. + ;; this method begins the recursive traversal through the tree of collide-shape-prims, starting with the + ;; root of each shape. (local-vars (v1-3 collide-action) (v1-4 float) (a2-2 collide-action) (a3-2 collide-action)) (rlet ((acc :class vf) (vf0 :class vf) @@ -47,40 +44,29 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (init-vf0-vector) - ;; reset the overlap result - (let ((v1-0 arg1)) - (set! (-> v1-0 best-dist) 0.0) - (set! (-> v1-0 best-from-prim) #f) - (set! (-> v1-0 best-to-prim) #f) - ) + (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-from-prim) #f) (set! (-> v1-0 best-to-prim) #f)) ;; grab the roots (let ((a0-1 (-> obj root-prim)) - (a1-1 (-> arg0 root-prim)) - ) - (let ((a3-0 (-> a0-1 collide-with)) ;; this object's collide with + (a1-1 (-> arg0 root-prim))) + (let ((a3-0 (-> a0-1 collide-with)) ;; this object's collide with (t0-0 (-> a1-1 prim-core collide-as)) ;; the incoming object's as - (v1-2 (-> a0-1 prim-core action)) ;; our action + (v1-2 (-> a0-1 prim-core action)) ;; our action ) - (let ((a2-1 (-> a1-1 prim-core action))) ;; their action + (let ((a2-1 (-> a1-1 prim-core action))) ;; their action ;; reject if (logand with as) fails (b! (zero? (logand a3-0 t0-0)) cfg-8 :delay (set! a3-2 (logand a2-1 1))) ;; reject if non-solid - (b! (zero? a3-2) cfg-8 :delay (set! a2-2 (logand a2-1 8))) - ) + (b! (zero? a3-2) cfg-8 :delay (set! a2-2 (logand a2-1 8)))) ;; reject if edgegrab-active on us fails (not sure what this means yet) - (b! (nonzero? a2-2) cfg-8 :delay (set! v1-3 (logand v1-2 1))) - ) + (b! (nonzero? a2-2) cfg-8 :delay (set! v1-3 (logand v1-2 1)))) ;; reject if non-solid (b! (zero? v1-3) cfg-8 :delay (nop!)) - ;; if we're here, our collision types allow us to collide (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) (.lvf vf2 (&-> a1-1 prim-core world-sphere quad)) - ;; see if bsphere's overlap (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -95,22 +81,11 @@ (.mov v1-4 vf5) (b! (<= f0-1 v1-4) cfg-8) ;; they don't, fail! ) - ;; our bsphere's overlap. We need a more detailed test to know for sure ;; this will dispatch a more specific method for a0-1. - (should-push-away-test a0-1 a1-1 arg1) - ) - + (should-push-away-test a0-1 a1-1 arg1)) ;; return the result of the more detailed test. - (let ((v0-1 (< (-> arg1 best-dist) 0.0))) - (b! #t cfg-9 :delay (nop!)) - (label cfg-8) - (set! v0-1 #f) - (label cfg-9) - v0-1 - ) - ) - ) + (let ((v0-1 (< (-> arg1 best-dist) 0.0))) (b! #t cfg-9 :delay (nop!)) (label cfg-8) (set! v0-1 #f) (label cfg-9) v0-1))) ;; the should-push-away-test will update the collide-overlap-result. The best-dist will be negative if they overlap. ;; it works on collide prims. @@ -118,8 +93,7 @@ (defmethod should-push-away-test ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) "Should be impossible to call - collide-shape-prim is abstract." (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") - (none) - ) + (none)) (defmethod should-push-away-test ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) "Update test for a group against an unknown prim. @@ -130,13 +104,11 @@ (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (init-vf0-vector) (nop!) (let ((s4-0 (-> obj prims)) - (s3-0 (-> obj num-prims-u)) - ) + (s3-0 (-> obj num-prims-u))) (nop!) ;; very similar to compute-overlap. ;; check collide-as/collide-with and solid @@ -152,13 +124,10 @@ (nop!) (let* ((a1-1 (-> a0-1 prim-core action)) (a2-2 (logand a2-1 v1-0)) - (a1-2 (logand a1-1 (collide-action solid))) - ) + (a1-2 (logand a1-1 (collide-action solid)))) ;; on reject, just move to the next thing in the group. (b! (zero? a2-2) cfg-1 :delay (.lvf vf2 (&-> a0-1 prim-core world-sphere quad))) - (b! (zero? a1-2) cfg-1 :delay (nop!)) - ) - ) + (b! (zero? a1-2) cfg-1 :delay (nop!)))) ;; check bspheres (.sub.vf vf3 vf2 vf1) (.add.w.vf vf4 vf2 vf1 :mask #b1000) @@ -168,23 +137,14 @@ (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) (.sub.w.vf vf3 vf3 vf4 :mask #b1000) - (let ((f0-0 0.0)) - (.add.w.vf vf3 vf0 vf3 :mask #b1) - (.mov a1-3 vf3) - (b! (<= f0-0 a1-3) cfg-1) - ) + (let ((f0-0 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a1-3 vf3) (b! (<= f0-0 a1-3) cfg-1)) ;; bspheres overlap, more accurate test is required. - (should-push-away-test a0-1 arg0 arg1) - ) - (set! v1-0 (-> arg0 prim-core collide-as)) - ) - ) + (should-push-away-test a0-1 arg0 arg1)) + (set! v1-0 (-> arg0 prim-core collide-as)))) (b! #t cfg-1 :delay (.lvf vf1 (&-> arg0 prim-core world-sphere quad))) (label cfg-6) 0 - (none) - ) - ) + (none))) (defmethod should-push-away-reverse-test ((obj collide-shape-prim) (arg0 collide-shape-prim-group) (arg1 collide-overlap-result)) "This is a flipped version of should-push-away-test. @@ -195,13 +155,11 @@ (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (init-vf0-vector) (nop!) (let ((s4-0 (-> arg0 prims)) - (s3-0 (-> arg0 num-prims-u)) - ) + (s3-0 (-> arg0 num-prims-u))) (nop!) (let ((v1-0 (-> obj collide-with))) (nop!) @@ -215,12 +173,9 @@ (nop!) (let* ((a0-1 (-> a1-1 prim-core action)) (a2-2 (logand v1-0 a2-1)) - (a0-2 (logand a0-1 (collide-action solid))) - ) + (a0-2 (logand a0-1 (collide-action solid)))) (b! (zero? a2-2) cfg-1 :delay (.lvf vf1 (&-> a1-1 prim-core world-sphere quad))) - (b! (zero? a0-2) cfg-1 :delay (nop!)) - ) - ) + (b! (zero? a0-2) cfg-1 :delay (nop!)))) (.sub.vf vf3 vf2 vf1) (.add.w.vf vf4 vf2 vf1 :mask #b1000) (.mul.vf vf3 vf3 vf3 :mask #b111) @@ -229,26 +184,16 @@ (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) (.sub.w.vf vf3 vf3 vf4 :mask #b1000) - (let ((f0-0 0.0)) - (.add.w.vf vf3 vf0 vf3 :mask #b1) - (.mov a0-3 vf3) - (b! (<= f0-0 a0-3) cfg-1) - ) - (should-push-away-test obj a1-1 arg1) - ) - (set! v1-0 (-> obj collide-with)) - ) - ) + (let ((f0-0 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a0-3 vf3) (b! (<= f0-0 a0-3) cfg-1)) + (should-push-away-test obj a1-1 arg1)) + (set! v1-0 (-> obj collide-with)))) (b! #t cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) (label cfg-6) 0 - (none) - ) - ) + (none))) (defmethod should-push-away-test ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) "Collide a prim with a mesh. The prim must be a sphere or group of spheres" - ;; first, check the prim type (let ((v1-0 (-> arg0 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (nop!)) @@ -257,36 +202,28 @@ (b! #t cfg-13 :delay (nop!)) (label cfg-2) ;; mesh to mesh. abort! - (b! (> v1-0 0) cfg-12 :delay (nop!)) - ) + (b! (> v1-0 0) cfg-12 :delay (nop!))) (let ((s3-0 (-> obj mesh))) ;; if we don't have a mesh, then abort. (b! (not s3-0) cfg-11 :delay (nop!)) ;; empty-form - ;; we must put the mesh in the cache before we can collide. ;; NOTE: this is not the full collide-cache, but instead a smaller, simpler collide-mesh-cche. (let ((s2-0 *collide-mesh-cache*)) (let ((v1-4 (-> s2-0 id))) ;; if we already got it, don't bother populating the cache again. - (b! (= (-> obj mesh-cache-id) v1-4) cfg-9 :delay (nop!)) - ) + (b! (= (-> obj mesh-cache-id) v1-4) cfg-9 :delay (nop!))) ;; "allocate" triangles. (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) (b! (not v1-8) cfg-7 :delay (nop!)) ;; remember that we got these triangles - (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8)) - ) + (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8))) ;; and remember the cache has this - (set! (-> obj mesh-cache-id) (-> s2-0 id)) - ) - + (set! (-> obj mesh-cache-id) (-> s2-0 id))) ;; load this mesh into the cache. ;; strangely, they transform the entire mesh. - (populate-cache! - s3-0 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - (-> obj cshape process node-list data (-> obj transform-index) bone transform) - ) + (populate-cache! s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (-> obj cshape process node-list data (-> obj transform-index) bone transform)) (b! #t cfg-9 :delay (nop!)) (label cfg-7) ;; cache failure abort (b! #t cfg-14 :delay (nop!)) @@ -294,20 +231,15 @@ (label cfg-9) ;; now, use the cache! (let ((s2-1 (new 'stack-no-clear 'collide-tri-result))) - (let ((f0-1 (should-push-away-test - s3-0 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - s2-1 - (the-as vector (-> arg0 prim-core)) - (-> arg1 best-dist) - ) - ) - ) + (let ((f0-1 (should-push-away-test s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + s2-1 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist)))) ;; did we find something closer? (b! (>= f0-1 (-> arg1 best-dist)) cfg-11 :delay #f) ;; we did! - (set! (-> arg1 best-dist) f0-1) - ) + (set! (-> arg1 best-dist) f0-1)) ;; remeber this triangle! (set! (-> arg1 best-from-prim) obj) (set! (-> arg1 best-to-prim) arg0) @@ -316,9 +248,7 @@ (set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-1 vertex 2 quad)) (set! (-> arg1 best-from-tri intersect quad) (-> s2-1 intersect quad)) (set! (-> arg1 best-from-tri normal quad) (-> s2-1 normal quad)) - (set! (-> arg1 best-from-tri pat) (-> s2-1 pat)) - ) - ) + (set! (-> arg1 best-from-tri pat) (-> s2-1 pat)))) (label cfg-11) (b! #t cfg-13 :delay (nop!)) (label cfg-12) @@ -326,8 +256,7 @@ (label cfg-13) 0 (label cfg-14) - (none) - ) + (none)) (defmethod should-push-away-test ((obj collide-shape-prim-sphere) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) "The push away where we manually dispatch on the type of the second." @@ -340,8 +269,7 @@ (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) - (vf6 :class vf) - ) + (vf6 :class vf)) (init-vf0-vector) (let ((v1-0 (-> arg0 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (nop!)) @@ -349,8 +277,7 @@ (should-push-away-reverse-test obj (the-as collide-shape-prim-group arg0) arg1) (b! #t cfg-13 :delay (nop!)) (label cfg-2) - (b! (> v1-0 0) cfg-5 :delay (nop!)) - ) + (b! (> v1-0 0) cfg-5 :delay (nop!))) ;; if we're here, it's sphere->sphere. (.lvf vf1 (&-> obj prim-core world-sphere quad)) (.lvf vf2 (&-> arg0 prim-core world-sphere quad)) @@ -377,64 +304,39 @@ (set! (-> arg1 best-from-prim) obj) (set! (-> arg1 best-to-prim) arg0) (.svf (&-> arg1 best-from-tri normal quad) vf3) - (set! (-> arg1 best-from-tri pat) v1-4) - ) - ) - ) - + (set! (-> arg1 best-from-tri pat) v1-4)))) ;; make up a triangle. (let ((s4-1 (-> arg1 best-from-tri normal)) - (s3-0 (-> arg1 best-from-tri intersect)) - ) + (s3-0 (-> arg1 best-from-tri intersect))) (vector-float*! s3-0 s4-1 (-> obj prim-core world-sphere w)) (vector+! s3-0 s3-0 (the-as vector (-> obj prim-core))) (set! (-> arg1 best-from-tri vertex 0 quad) (-> s3-0 quad)) (point-in-plane-<-point+normal! (-> arg1 best-from-tri vertex 1) s3-0 s4-1) - (let* ((v1-10 (vector-normalize! - (vector-! - (new 'stack-no-clear 'vector) - (-> arg1 best-from-tri vertex 1) - (the-as vector (-> arg1 best-from-tri)) - ) - 1.0 - ) - ) - (a2-4 (vector-cross! (new 'stack-no-clear 'vector) s4-1 v1-10)) - ) - (vector+*! (-> arg1 best-from-tri vertex 2) s3-0 a2-4 4096.0) - ) - ) + (let* ((v1-10 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-from-tri vertex 1) (the-as vector (-> arg1 best-from-tri))) + 1.0)) + (a2-4 (vector-cross! (new 'stack-no-clear 'vector) s4-1 v1-10))) + (vector+*! (-> arg1 best-from-tri vertex 2) s3-0 a2-4 4096.0))) (b! #t cfg-13 :delay (nop!)) - ;; Mesh. this is the same as the above function. start with populating the cache. (label cfg-5) (let ((s3-1 (-> (the-as collide-shape-prim-mesh arg0) mesh))) (b! (not s3-1) cfg-13) (let ((s2-0 *collide-mesh-cache*)) - (let ((v1-13 (-> s2-0 id))) - (b! (= (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) v1-13) cfg-11) - ) + (let ((v1-13 (-> s2-0 id))) (b! (= (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) v1-13) cfg-11)) (let ((v1-17 (allocate! s2-0 (* 96 (-> s3-1 num-tris))))) (b! (not v1-17) cfg-9 :delay (nop!)) - (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris) - (the-as (inline-array collide-mesh-cache-tri) v1-17) - ) - ) - (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) (-> s2-0 id)) - ) - (populate-cache! - s3-1 - (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) - (-> (the-as collide-shape-prim-mesh arg0) - cshape - process - node-list - data - (-> (the-as collide-shape-prim-mesh arg0) transform-index) - bone - transform - ) - ) + (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17))) + (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) (-> s2-0 id))) + (populate-cache! s3-1 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) + (-> (the-as collide-shape-prim-mesh arg0) + cshape + process + node-list + data + (-> (the-as collide-shape-prim-mesh arg0) transform-index) + bone + transform)) (b! #t cfg-11 :delay (nop!)) (label cfg-9) (b! #t cfg-14 :delay (nop!)) @@ -442,18 +344,13 @@ (label cfg-11) ;; do the collision (let ((s2-1 (new 'stack-no-clear 'collide-tri-result))) - (let ((f0-2 (should-push-away-test - s3-1 - (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) - s2-1 - (the-as vector (-> obj prim-core)) - (-> arg1 best-dist) - ) - ) - ) + (let ((f0-2 (should-push-away-test s3-1 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) + s2-1 + (the-as vector (-> obj prim-core)) + (-> arg1 best-dist)))) (b! (>= f0-2 (-> arg1 best-dist)) cfg-13 :delay #f) - (set! (-> arg1 best-dist) f0-2) - ) + (set! (-> arg1 best-dist) f0-2)) ;; but this time, we need a tri from the sphere. So make one up again. (set! (-> arg1 best-from-prim) obj) (set! (-> arg1 best-to-prim) arg0) @@ -465,31 +362,15 @@ (vector+! s3-2 s3-2 (the-as vector (-> obj prim-core))) (set! (-> arg1 best-from-tri vertex 0 quad) (-> s3-2 quad)) (point-in-plane-<-point+normal! (-> arg1 best-from-tri vertex 1) s3-2 s4-2) - (let* ((v1-37 (vector-normalize! - (vector-! - (new 'stack-no-clear 'vector) - (-> arg1 best-from-tri vertex 1) - (the-as vector (-> arg1 best-from-tri)) - ) - 1.0 - ) - ) - (a2-11 (vector-cross! (new 'stack-no-clear 'vector) s4-2 v1-37)) - ) - (vector+*! (-> arg1 best-from-tri vertex 2) s3-2 a2-11 4096.0) - ) - ) - ) - ) - ) + (let* ((v1-37 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-from-tri vertex 1) (the-as vector (-> arg1 best-from-tri))) + 1.0)) + (a2-11 (vector-cross! (new 'stack-no-clear 'vector) s4-2 v1-37))) + (vector+*! (-> arg1 best-from-tri vertex 2) s3-2 a2-11 4096.0)))))) (set! (-> arg1 best-from-tri pat) (-> obj pat)) (label cfg-13) 0 (label cfg-14) - (none) - ) - ) - + (none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Moving Collision Resolutions @@ -504,9 +385,7 @@ (defmethod collide-with-collide-cache-prim-mesh ((obj collide-shape-prim) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) "abstract base class version." (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") - (none) - ) - + (none)) (defmethod collide-with-collide-cache-prim-mesh ((obj collide-shape-prim-sphere) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) "Collide this sphere with the mesh in the real collide cache." @@ -515,20 +394,10 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (let* ((s5-0 (new 'stack-no-clear 'collide-tri-result)) ;; try to move the sphere by best-u. - (f0-1 (resolve-moving-sphere-tri - arg1 - s5-0 - (-> obj prim-core) - (-> arg0 move-vec) - (-> arg0 best-u) - (-> obj prim-core action) - ) - ) - ) + (f0-1 (resolve-moving-sphere-tri arg1 s5-0 (-> obj prim-core) (-> arg0 move-vec) (-> arg0 best-u) (-> obj prim-core action)))) ;; did we hit something? (when (>= f0-1 0.0) ;; yup. @@ -538,8 +407,7 @@ (a3-1 2) (t0-1 (-> arg1 prim)) (v1-3 0) - (a0-2 (-> arg1 prim-core offense)) - ) + (a0-2 (-> arg1 prim-core offense))) (b! (!= a1-2 a3-1) cfg-3 :likely-delay (set! a2-2 t0-1)) (label cfg-3) (nop!) @@ -550,25 +418,18 @@ (let ((t0-2 (-> arg1 prim-core action))) (b! (= a0-2 v1-3) cfg-7 :delay (set! v1-4 (- a3-2 a0-2))) (let ((a1-4 (logand a1-3 t0-2)) - (a0-3 (-> s5-0 pat)) - ) + (a0-3 (-> s5-0 pat))) (let ((a1-5 (logand a1-4 (collide-action solid)))) (.lvf vf1 (&-> s5-0 intersect quad)) (b! (> (the-as int v1-4) 0) cfg-7 :delay (.lvf vf2 (&-> s5-0 normal quad))) - (b! (zero? a1-5) cfg-7 :delay (.lvf vf3 (&-> s5-0 vertex 0 quad))) - ) + (b! (zero? a1-5) cfg-7 :delay (.lvf vf3 (&-> s5-0 vertex 0 quad)))) (.lvf vf4 (&-> s5-0 vertex 1 quad)) (.lvf vf5 (&-> s5-0 vertex 2 quad)) ;; remember what we hit (set! (-> arg0 best-u) f0-1) (set! (-> arg0 best-to-prim) a2-2) (set! (-> arg0 best-from-prim) obj) - (set! (-> arg0 best-tri pat) a0-3) - ) - ) - ) - ) - ) + (set! (-> arg0 best-tri pat) a0-3)))))) ;; remember the tri (.svf (&-> arg0 best-tri intersect quad) vf1) (.svf (&-> arg0 best-tri normal quad) vf2) @@ -579,39 +440,26 @@ (label cfg-7) (b! (= a2-2 #f) cfg-9 :delay (nop!)) ;; add prim to list. - (add-touching-prims *touching-list* obj a2-2 f0-1 (the-as collide-tri-result #f) s5-0) - ) + (add-touching-prims *touching-list* obj a2-2 f0-1 (the-as collide-tri-result #f) s5-0)) (label cfg-9) - 0 - ) - ) + 0)) 0 - (none) - ) - ) + (none))) (defmethod collide-with-collide-cache-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") - (none) - ) + (none)) (defmethod collide-with-collide-cache-prim-mesh ((obj collide-shape-prim-group) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (let ((s3-0 (-> arg1 prim-core collide-as))) (dotimes (s2-0 (-> obj num-prims)) (let ((a0-1 (-> obj prims s2-0))) - (if (logtest? (-> a0-1 collide-with) s3-0) - (collide-with-collide-cache-prim-mesh a0-1 arg0 arg1) - ) - ) - ) - ) - (none) - ) + (if (logtest? (-> a0-1 collide-with) s3-0) (collide-with-collide-cache-prim-mesh a0-1 arg0 arg1))))) + (none)) (defmethod collide-with-collide-cache-prim-sphere ((obj collide-shape-prim) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") - (none) - ) + (none)) (defmethod collide-with-collide-cache-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (local-vars (v1-4 collide-offense) (a3-2 pat-surface)) @@ -619,36 +467,27 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (let* ((s5-0 (new 'stack-no-clear 'collide-tri-result)) - (f0-1 (resolve-moving-sphere-sphere - arg1 - s5-0 - (-> obj prim-core) - (-> arg0 move-vec) - (-> arg0 best-u) - (-> obj prim-core action) - ) - ) - ) + (f0-1 (resolve-moving-sphere-sphere arg1 + s5-0 + (-> obj prim-core) + (-> arg0 move-vec) + (-> arg0 best-u) + (-> obj prim-core action)))) (when (>= f0-1 0.0) (let ((v1-3 0) - (a1-2 (-> obj prim-core action)) - ) + (a1-2 (-> obj prim-core action))) (nop!) (let ((a2-2 (-> arg1 prim-core action))) (nop!) (let ((a0-2 (-> arg1 prim-core offense)) (a1-3 (logand a1-2 a2-2)) - (a2-3 (-> arg1 prim)) - ) + (a2-3 (-> arg1 prim))) (let ((a3-1 (logand a1-3 (collide-action solid))) - (a1-4 (-> obj prim-core offense)) - ) + (a1-4 (-> obj prim-core offense))) (b! (zero? a3-1) cfg-5 :delay (set! a3-2 (-> s5-0 pat))) - (b! (= a0-2 v1-3) cfg-5 :delay (set! v1-4 (- a1-4 a0-2))) - ) + (b! (= a0-2 v1-3) cfg-5 :delay (set! v1-4 (- a1-4 a0-2)))) (b! (> (the-as int v1-4) 0) cfg-5 :delay (.lvf vf1 (&-> s5-0 intersect quad))) (.lvf vf2 (&-> s5-0 normal quad)) (.lvf vf3 (&-> s5-0 vertex 0 quad)) @@ -664,34 +503,20 @@ (.svf (&-> arg0 best-tri vertex 1 quad) vf4) (.svf (&-> arg0 best-tri vertex 2 quad) vf5) (label cfg-5) - (add-touching-prims *touching-list* obj a2-3 f0-1 (the-as collide-tri-result #f) s5-0) - ) - ) - ) - ) - ) + (add-touching-prims *touching-list* obj a2-3 f0-1 (the-as collide-tri-result #f) s5-0)))))) 0 - (none) - ) - ) + (none))) (defmethod collide-with-collide-cache-prim-sphere ((obj collide-shape-prim-mesh) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") - (none) - ) + (none)) (defmethod collide-with-collide-cache-prim-sphere ((obj collide-shape-prim-group) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (let ((s3-0 (-> arg1 prim-core collide-as))) (dotimes (s2-0 (-> obj num-prims)) (let ((a0-1 (-> obj prims s2-0))) - (if (logtest? (-> a0-1 collide-with) s3-0) - (collide-with-collide-cache-prim-sphere a0-1 arg0 arg1) - ) - ) - ) - ) - (none) - ) + (if (logtest? (-> a0-1 collide-with) s3-0) (collide-with-collide-cache-prim-sphere a0-1 arg0 arg1))))) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Target Specific Stuff @@ -700,206 +525,138 @@ ;; This implements the default collision reaction function. ;; This is a target-specific reaction. - (defun find-ground-point ((target-ctrl control-info) (ground-result vector) (start-len float) (max-len float)) "Find somewhere safe to land. This is used to find where to bounce back the player if you jump on fire canyon. It's a nice example function for the collision system." (local-vars (direction-idx int) (sv-192 int)) - ;; first, let's find our heading (let ((current-heading (if (< 819.2 (vector-xz-length (-> target-ctrl transv))) ;; if we're moving in the xz plane - (vector-y-angle (-> target-ctrl transv)) ;; use the direction we're moving - (y-angle target-ctrl) ;; otherwise, use the direction we're facing. - ) - ) + (vector-y-angle (-> target-ctrl transv)) ;; use the direction we're moving + (y-angle target-ctrl) ;; otherwise, use the direction we're facing. + )) ;; the current position of jak (current-pos (-> target-ctrl trans)) (probe-dir (new 'stack-no-clear 'vector)) - (result-tri (new 'stack-no-clear 'collide-tri-result)) - ) - + (result-tri (new 'stack-no-clear 'collide-tri-result))) ;; create a bounding box, centered around our current location. (let ((bbox (new 'stack-no-clear 'bounding-box))) (set! (-> ground-result w) 0.0) ;; look at most max-len away from where we are.. (dotimes (v1-1 3) (set! (-> bbox min data v1-1) (- (-> current-pos data v1-1) max-len)) - (set! (-> bbox max data v1-1) (+ (-> current-pos data v1-1) max-len)) - ) + (set! (-> bbox max data v1-1) (+ (-> current-pos data v1-1) max-len))) ;; except for in y (height). Look 10m down, and 5m up. (set! (-> bbox min y) (+ -40960.0 (-> current-pos y))) (set! (-> bbox max y) (+ 20480.0 (-> current-pos y))) - ;; fill the collide cache will all the triangles in bounding box. - (fill-using-bounding-box - *collide-cache* - bbox - (-> target-ctrl root-prim collide-with) - (-> target-ctrl process) - (new 'static 'pat-surface :noentity #x1) - ) - ) - + (fill-using-bounding-box *collide-cache* + bbox + (-> target-ctrl root-prim collide-with) + (-> target-ctrl process) + (new 'static 'pat-surface :noentity #x1))) ;; loop over 8 directions to check. (set! direction-idx 0) (while (< direction-idx 8) ;; this picks starts with the current direction, then a little to the left, then a little to the right, ;; then a little more to the left.... so ideally we go in the direction the player is facing, if that's possible. - (let ((probe-heading (+ current-heading (if (zero? (logand direction-idx 1)) - (* 8192.0 (the float (/ direction-idx 2))) - (* -8192.0 (the float (/ direction-idx 2))) - ) - ) - ) - ) - + (let ((probe-heading (+ current-heading + (if (zero? (logand direction-idx 1)) (* 8192.0 (the float (/ direction-idx 2))) (* -8192.0 (the float (/ direction-idx 2))))))) ;; this will count the number of hits we have in this direction. (set! sv-192 0) - ;; we don't know anything, so assume we can go the maximum length in this direction (let ((max-len-this-dir max-len)) ;; but, if we did max-len bounce in this direction, we might hit some wall mid-bounce. - ;; start with a probe of max len, pointing straight forward. (set-vector! probe-dir 0.0 0.0 max-len 1.0) ;; rotate to point along our heading (vector-rotate-y! probe-dir probe-dir probe-heading) - ;; see how far we can go, 10m above the current target. ;; this is likely checking to see if we'll hit a wall mid-bounce - (if (>= (probe-using-line-sphere - *collide-cache* - (vector+! (new 'stack-no-clear 'vector) current-pos (new 'static 'vector :y 20480.0 :w 1.0)) - probe-dir - 2048.0 - (-> target-ctrl root-prim collide-with) - result-tri - (new 'static 'pat-surface :noentity #x1) - ) - 0.0 - ) - (set! max-len-this-dir (+ -6144.0 (vector-vector-xz-distance current-pos (-> result-tri intersect)))) - ) - + (if (>= (probe-using-line-sphere *collide-cache* + (vector+! (new 'stack-no-clear 'vector) current-pos (new 'static 'vector :y 20480.0 :w 1.0)) + probe-dir + 2048.0 + (-> target-ctrl root-prim collide-with) + result-tri + (new 'static 'pat-surface :noentity #x1)) + 0.0) + (set! max-len-this-dir (+ -6144.0 (vector-vector-xz-distance current-pos (-> result-tri intersect))))) ;; now, let's search between start-len and max-len-this-dir to see if there's somewhere safe to bounce. (let ((current-len start-len)) (while (>= max-len-this-dir current-len) ;; probe heading (set-vector! probe-dir 0.0 0.0 current-len 1.0) (vector-rotate-y! probe-dir probe-dir probe-heading) - ;; put probe dir at the end of the probe (vector+! probe-dir current-pos probe-dir) ;; start 10m above the curren pos. (set! (-> probe-dir y) (+ 20480.0 (-> current-pos y))) ;; and probe straight down, to find the first ground after a 10m jump. - (when (>= (probe-using-line-sphere - *collide-cache* - probe-dir - (new 'static 'vector :y -251658240.0 :w 1.0) - 10240.0 - (-> target-ctrl root-prim collide-with) - result-tri - (new 'static 'pat-surface :noentity #x1) - ) - 0.0 - ) + (when (>= (probe-using-line-sphere *collide-cache* + probe-dir + (new 'static 'vector :y -251658240.0 :w 1.0) + 10240.0 + (-> target-ctrl root-prim collide-with) + result-tri + (new 'static 'pat-surface :noentity #x1)) + 0.0) (cond ((and (= (-> result-tri pat mode) (pat-mode ground)) ;; we found ground (= (-> result-tri pat event) (pat-event none)) ;; and it's not more dangerous ground - (< 0.7 (-> result-tri normal y)) ;; and it's pretty flat + (< 0.7 (-> result-tri normal y)) ;; and it's pretty flat ) (set! (-> ground-result quad) (-> result-tri intersect quad)) ;; remember it ;; count this as a success (set! sv-192 (+ sv-192 1)) ;; if we get 2 or more hits, it seems like a good place to land, let's do it! - (if (>= sv-192 2) - (return ground-result) - ) - ) + (if (>= sv-192 2) (return ground-result))) ((and (= (-> result-tri pat mode) (pat-mode wall)) (< (+ 4096.0 (-> current-pos y)) (-> result-tri intersect y))) ;; give up on this direction. There's a wall in the way (missed by the earlier fast wall check) - (goto cfg-35) - ) - ) - ) + (goto cfg-35)))) ;; move 1m out more. - (set! current-len (+ 4096.0 current-len)) - ) - ) - ) - ) + (set! current-len (+ 4096.0 current-len)))))) (label cfg-35) - (set! direction-idx (+ direction-idx 1)) - ) - ) - (the-as vector #f) - ) + (set! direction-idx (+ direction-idx 1)))) + (the-as vector #f)) (defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol)) "Handle an attack up. This launches the player in the air, forcing them back to a safe location." ;; attempt to find a safe ground. (let ((s4-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) (meters 2) (meters 10)))) - (set! s4-0 (cond - (s4-0 ;; if we found it, use that - s4-0 - ) - (else - ;; failed to find it. Use the last known safe ground point instaed. - (-> arg0 control last-known-safe-ground) - ) - ) - ) + (set! s4-0 + (cond + (s4-0 ;; if we found it, use that + s4-0) + (else + ;; failed to find it. Use the last known safe ground point instaed. + (-> arg0 control last-known-safe-ground)))) (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans))) ;; jump direction - (f30-1 (fmax (meters 2) (fmin (meters 10) (vector-xz-length s2-1)))) ;; distance we should jump (limited) + (f30-1 (fmax (meters 2) (fmin (meters 10) (vector-xz-length s2-1)))) ;; distance we should jump (limited) ) ;; note: the above limit is the same as the limit passed into find-ground-point. So the limiting should only kick in ;; if we use last safe ground. (cond - ((< (fabs (vector-dot - (-> arg0 control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)) - ) - ) - (meters 10) - ) + ((< (fabs (vector-dot (-> arg0 control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)))) + (meters 10)) ;; if we reach here, we have to jump up or down less than 10m. ;; reduce our jump direction to within reasonable distance (vector-xz-normalize! s2-1 f30-1) ;; send an attack ;; the shove is proportional to how high we jump (and has a min, so we at least get off the ground) - (send-event - arg0 - arg1 - #f - (static-attack-info - ((mode arg2) - (vector s2-1) - (shove-up - (+ (lerp-scale (meters 1) (meters 4) f30-1 (meters 1) (meters 10)) (fmax 0.0 (- (-> s4-0 y) (-> arg0 control trans y)))) - ) - (angle 'up) - ) - ) - ) - ) + (send-event arg0 + arg1 + #f + (static-attack-info ((mode arg2) (vector s2-1) + (shove-up (+ (lerp-scale (meters 1) (meters 4) f30-1 (meters 1) (meters 10)) (fmax 0.0 (- (-> s4-0 y) (-> arg0 control trans y))))) + (angle 'up))))) (else - ;; the last safest place we jumped is too high. just launch jak in the air and hope for the best. - ;; fire canyon skip jumps - (send-event arg0 arg1 #f (static-attack-info ((mode arg2) - (vector (new 'static 'vector :y (meters 10) :w 1.0)) - (shove-up (meters 10)) - (angle 'up) - (control 1.0) - ) - ) - ) - ) - ) - ) - ) - (none) - ) + ;; the last safest place we jumped is too high. just launch jak in the air and hope for the best. + ;; fire canyon skip jumps + (send-event arg0 + arg1 + #f + (static-attack-info ((mode arg2) (vector (new 'static 'vector :y (meters 10) :w 1.0)) (shove-up (meters 10)) (angle 'up) (control 1.0)))))))) + (none)) (defmethod set-and-handle-pat! ((obj collide-shape-moving) (arg0 pat-surface)) "Handle landing on the given pat-surface. This is likely target-specific." @@ -908,62 +665,37 @@ (set! (-> obj poly-pat) arg0) ;; set our surface (case (-> arg0 material) - (((pat-material ice)) - (set! (-> obj surf) *ice-surface*) - ) - (((pat-material quicksand)) - (set! (-> obj surf) *quicksand-surface*) - ) - (((pat-material tube)) - (set! (-> obj surf) *no-walk-surface*) - ) - (((pat-material rotate)) - (set! (-> obj surf) *rotate-surface*) - ) - (else - (set! (-> obj surf) *standard-ground-surface*) - ) - ) - + (((pat-material ice)) (set! (-> obj surf) *ice-surface*)) + (((pat-material quicksand)) (set! (-> obj surf) *quicksand-surface*)) + (((pat-material tube)) (set! (-> obj surf) *no-walk-surface*)) + (((pat-material rotate)) (set! (-> obj surf) *rotate-surface*)) + (else (set! (-> obj surf) *standard-ground-surface*))) ;; racer gets set whenever you get on the zoomer. If we are on the zoomer, just go to "race-track" - (if (logtest? (-> obj root-prim prim-core action) (collide-action racer)) - (set! (-> obj surf) *race-track-surface*) - ) - + (if (logtest? (-> obj root-prim prim-core action) (collide-action racer)) (set! (-> obj surf) *race-track-surface*)) (when (nonzero? (-> arg0 event)) (case (-> arg0 event) (((pat-event deadly)) ;; deadly. Send a deadly event - (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'deadly) (shove-up (meters 3))))) - ) + (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'deadly) (shove-up (meters 3)))))) (((pat-event burn)) ;; burn. Send a burn event - (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'burn) (shove-up (meters 3))))) - ) + (send-event (-> obj process) 'attack #f (static-attack-info ((mode 'burn) (shove-up (meters 3)))))) (((pat-event deadlyup)) ;; deadlyup. Launch! - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) - ) + (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup)) (((pat-event burnup)) ;; burnup (like fire canyon lava). ;; only send if we don't have racer (on zoomer) (if (zero? (logand (-> (the-as target (-> obj process)) control root-prim prim-core action) (collide-action racer))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) - ) - ) + (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup))) (((pat-event melt)) ;; just send melt - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'melt)))) - ) + (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'melt))))) (((pat-event endlessfall)) ;; endless pit death plane. - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'endlessfall)))) - ) - ) - ) + (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((mode 'endlessfall))))))) 0 - (none) - ) + (none)) (defun default-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) "Move into collision!" @@ -973,39 +705,27 @@ (set! sv-72 (new 'stack-no-clear 'vector)) (set! sv-80 0) (set! (-> sv-72 quad) (-> arg3 quad)) - ;; move along the vector by the best move-vec ;; this will hit the best-tri (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u)) - (move-by-vector! arg0 a1-1) - ) - + (move-by-vector! arg0 a1-1)) ;; so handle hitting that tri (set-and-handle-pat! arg0 (-> arg1 best-tri pat)) (vector-! sv-64 (the-as vector (-> arg1 best-from-prim prim-core)) (-> arg1 best-tri intersect)) (set! (-> sv-64 w) 1.0) (vector-normalize! sv-64 1.0) (set! (-> arg0 coverage) (vector-dot sv-64 (-> arg1 best-tri normal))) - (let ((v1-16 (-> sv-64 quad))) - (set! (-> sv-68 quad) v1-16) - ) + (let ((v1-16 (-> sv-64 quad))) (set! (-> sv-68 quad) v1-16)) ;; ? - (if (= (-> arg1 best-u) 0.0) - (move-by-vector! arg0 sv-68) - ) - + (if (= (-> arg1 best-u) 0.0) (move-by-vector! arg0 sv-68)) ;; (set! (-> arg0 surface-normal quad) (-> sv-68 quad)) (set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad)) (set! (-> arg0 surface-angle) (vector-dot sv-68 (-> arg0 dynam gravity-normal))) (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) - (set! (-> arg0 touch-angle) - (vector-dot sv-68 (vector-normalize! (vector-negate! (new-stack-vector0) sv-72) 1.0)) - ) - (if (< (-> arg0 poly-angle) -0.2) - (set! sv-80 (logior sv-80 16)) - ) + (set! (-> arg0 touch-angle) (vector-dot sv-68 (vector-normalize! (vector-negate! (new-stack-vector0) sv-72) 1.0))) + (if (< (-> arg0 poly-angle) -0.2) (set! sv-80 (logior sv-80 16))) (set! sv-128 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) (when (zero? (logand (-> arg0 prev-status) 1)) ;; hit the ground! @@ -1014,54 +734,34 @@ (let ((f30-0 (- 1.0 (-> arg0 surf impact-fric)))) (when (< f30-0 1.0) (let ((s3-1 (new-stack-vector0)) - (f28-0 (vector-dot (-> arg0 dynam gravity-normal) sv-72)) - ) + (f28-0 (vector-dot (-> arg0 dynam gravity-normal) sv-72))) 0.0 (vector-! s3-1 sv-72 (vector-float*! s3-1 (-> arg0 dynam gravity-normal) f28-0)) (let* ((f0-22 (vector-length s3-1)) - (f1-4 f0-22) - ) - (if (< f28-0 0.0) - (set! f28-0 (* f28-0 f30-0)) - ) - (vector+! - sv-72 - (vector-float*! sv-72 (-> arg0 dynam gravity-normal) f28-0) - (vector-float*! s3-1 s3-1 (/ f0-22 f1-4)) - ) - ) - ) - ) - ) - ) - ) + (f1-4 f0-22)) + (if (< f28-0 0.0) (set! f28-0 (* f28-0 f30-0))) + (vector+! sv-72 (vector-float*! sv-72 (-> arg0 dynam gravity-normal) f28-0) (vector-float*! s3-1 s3-1 (/ f0-22 f1-4))))))))) ;; set t-surf (touching a surface) (set! sv-80 (logior sv-80 4)) (if (-> arg1 best-to-prim) - (set! sv-80 (logior sv-80 32)) ;; t-ceil. not sure why this is the case. - ) + (set! sv-80 (logior sv-80 32)) ;; t-ceil. not sure why this is the case. + ) (cond (sv-128 - (set! sv-80 (logior sv-80 8)) ;; using it as a wall - (set! (-> arg0 cur-pat mode) 1) - ) + (set! sv-80 (logior sv-80 8)) ;; using it as a wall + (set! (-> arg0 cur-pat mode) 1)) (else - (set! sv-80 (logior sv-80 1)) ;; on. - (set! (-> arg0 local-normal quad) (-> sv-68 quad)) - ) - ) + (set! sv-80 (logior sv-80 1)) ;; on. + (set! (-> arg0 local-normal quad) (-> sv-68 quad)))) (vector-reflect-flat! arg2 sv-72 sv-68) (when (and (not sv-128) (>= (-> arg0 coverage) 0.9)) (set! sv-80 (logior sv-80 2)) (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (when (!= (-> arg0 poly-pat mode) (pat-mode wall)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) - (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) - ) - ) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)))) (logior! (-> arg0 status) sv-80) - (the-as cshape-moving-flags sv-80) - ) + (the-as cshape-moving-flags sv-80)) (defun simple-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) "A much simpler collide reaction." @@ -1069,43 +769,29 @@ (let ((a1-1 (new 'stack-no-clear 'vector))) ;; move by the amount we should. (vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u)) - (move-by-vector! arg0 a1-1) - ) + (move-by-vector! arg0 a1-1)) (let ((f0-2 (vector-dot (-> arg0 transv) (-> arg1 best-tri normal))) - (v1-6 (new 'stack-no-clear 'vector)) - ) + (v1-6 (new 'stack-no-clear 'vector))) ;; bounce off (vector-float*! v1-6 (-> arg1 best-tri normal) (* 1.5 f0-2)) - (vector-! (-> arg0 transv) (-> arg0 transv) v1-6) - ) - (let ((v0-1 (logior s5-0 7))) - (logior! (-> arg0 status) v0-1) - (the-as cshape-moving-flags v0-1) - ) - ) - ) + (vector-! (-> arg0 transv) (-> arg0 transv) v1-6)) + (let ((v0-1 (logior s5-0 7))) (logior! (-> arg0 status) v0-1) (the-as cshape-moving-flags v0-1)))) (defmethod step-collison! ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float)) "Take 1 step in the collision. Attempt to move at velocity of arg1, for arg2 of a step. The resulting velocity is stored in arg0. The amount of a step actually taken is returned." - (local-vars (sv-192 int)) (let ((s5-0 (new 'stack 'collide-shape-intersect)) - (s2-0 (new 'stack-no-clear 'vector)) - ) - + (s2-0 (new 'stack-no-clear 'vector))) ;; integrate our velocity, get the "move vector" ;; which is what we'd move if we hit nothing. (vector-float*! s2-0 arg1 (* arg2 (-> *display* seconds-per-frame))) - ;; initialize the collision data. (init! s5-0 s2-0) - ;; only if we have something in the collide cache, I guess. (let* ((s1-1 (-> obj root-prim)) (v1-4 *collide-cache*) - (s0-0 (the-as collide-cache-prim (-> v1-4 prims))) - ) + (s0-0 (the-as collide-cache-prim (-> v1-4 prims)))) (set! sv-192 (-> v1-4 num-prims)) ;; collide with everything in the collide cache. (while (nonzero? sv-192) @@ -1113,114 +799,78 @@ (when (logtest? (-> s1-1 collide-with) (-> s0-0 prim-core collide-as)) ;; pick between sphere and mesh. (if (>= (-> s0-0 prim-core prim-type) 0) - (collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0) - (collide-with-collide-cache-prim-sphere s1-1 s5-0 s0-0) - ) - ) - (set! s0-0 (-> (the-as (inline-array collide-cache-prim) s0-0) 1)) - ) - ) - + (collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0) + (collide-with-collide-cache-prim-sphere s1-1 s5-0 s0-0))) + (set! s0-0 (-> (the-as (inline-array collide-cache-prim) s0-0) 1)))) ;; now we've collided with everything. If we have a best-u of > 0, it means we can't do the full move. (let ((f30-0 (-> s5-0 best-u))) (cond ((>= f30-0 0.0) (let ((s2-1 (new 'stack-no-clear 'vector))) - ;; if debugging, remember our input velocity. - (if *display-collision-marks* - (set! (-> s2-1 quad) (-> arg1 quad)) - ) - + (if *display-collision-marks* (set! (-> s2-1 quad) (-> arg1 quad))) ;; do the collision reaction! this function should move the collide shape. (set! (-> obj prev-status) (the-as cshape-moving-flags ((-> obj reaction) obj s5-0 arg0 arg1))) - ;; debug draw collision marks. (when *display-collision-marks* (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-tri pat mode) hilite-color))) - (add-debug-outline-triangle - #t - (bucket-id debug-no-zbuf) - (the-as vector (-> s5-0 best-tri)) - (-> s5-0 best-tri vertex 1) - (-> s5-0 best-tri vertex 2) - t1-0 - ) - ) - (add-debug-vector - #t - (bucket-id debug-no-zbuf) - (-> s5-0 best-tri intersect) - s2-1 - (meters 0.00007324219) - (new 'static 'rgba :r #xff :g #xa0 :a #x80) - ) - (add-debug-vector - #t - (bucket-id debug-no-zbuf) - (-> s5-0 best-tri intersect) - arg0 - (meters 0.00007324219) - (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - ) + (add-debug-outline-triangle #t + (bucket-id debug-no-zbuf) + (the-as vector (-> s5-0 best-tri)) + (-> s5-0 best-tri vertex 1) + (-> s5-0 best-tri vertex 2) + t1-0)) + (add-debug-vector #t + (bucket-id debug-no-zbuf) + (-> s5-0 best-tri intersect) + s2-1 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xa0 :a #x80)) + (add-debug-vector #t + (bucket-id debug-no-zbuf) + (-> s5-0 best-tri intersect) + arg0 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (if (= (-> obj process type) target) - (add-debug-vector - #t - (bucket-id debug-no-zbuf) - (-> s5-0 best-tri intersect) - (-> obj surface-normal) - (meters 0.5) - (-> *pat-mode-info* (-> obj cur-pat mode) hilite-color) - ) - ) - ) - ) - + (add-debug-vector #t + (bucket-id debug-no-zbuf) + (-> s5-0 best-tri intersect) + (-> obj surface-normal) + (meters 0.5) + (-> *pat-mode-info* (-> obj cur-pat mode) hilite-color))))) ;; and return the step size we could take. - (return f30-0) - ) + (return f30-0)) (else - ;; didn't hit anything! call the no-reaction function. - (set! (-> obj reaction-flag) (cshape-reaction-flags)) - ((-> obj no-reaction) obj s5-0 arg0 arg1) - (set! (-> obj prev-status) (cshape-moving-flags)) - ;; and do the move ourself - (move-by-vector! obj s2-0) - ;; velocity is unchanged - (set! (-> arg0 quad) (-> arg1 quad)) - ;; moved the whole way! - (return 1.0) - ) - ) - ) - ) - 1.0 - ) + ;; didn't hit anything! call the no-reaction function. + (set! (-> obj reaction-flag) (cshape-reaction-flags)) + ((-> obj no-reaction) obj s5-0 arg0 arg1) + (set! (-> obj prev-status) (cshape-moving-flags)) + ;; and do the move ourself + (move-by-vector! obj s2-0) + ;; velocity is unchanged + (set! (-> arg0 quad) (-> arg1 quad)) + ;; moved the whole way! + (return 1.0))))) + 1.0) (defmethod integrate-and-collide! ((obj collide-shape) (arg0 vector)) "For a non-moving collide shape, we just move ourself. We have no reaction to anything we hit." (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) - (vf2 :class vf) - ) + (vf2 :class vf)) (init-vf0-vector) (let ((t9-0 (method-of-object obj move-by-vector!)) - (v1-1 (new 'stack-no-clear 'vector)) - ) + (v1-1 (new 'stack-no-clear 'vector))) (.lvf vf1 (&-> arg0 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) - (.mov at-0 f0-0) - ) + (let ((f0-0 (-> *display* seconds-per-frame))) (.mov at-0 f0-0)) (.mov vf2 at-0) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-1 quad) vf1) - (t9-0 obj v1-1) - ) - (none) - ) - ) + (t9-0 obj v1-1)) + (none))) (defmethod integrate-and-collide! ((obj collide-shape-moving) (arg0 vector)) "Integrate forward, with collisions and collision responses. @@ -1228,39 +878,21 @@ It will process updates from hitting triangles with pat-surfaces It will update the touching list. It will update the current surface and surface flags." - ;; update the world-spheres for us and our children. (update-transforms! obj) - ;; remember our history (set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad)) (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) (set! (-> obj prev-status) (-> obj status)) - ;; setup - (logclear! (-> obj status) (cshape-moving-flags - onsurf - onground - tsurf - twall - t-ciel - t-act - csmf06 - csmf07 - csmf09 - on-water - csmf11 - csmf12 - csmf13 - ) - ) + (logclear! (-> obj status) + (cshape-moving-flags onsurf onground tsurf twall t-ciel t-act csmf06 csmf07 csmf09 on-water csmf11 csmf12 csmf13)) (set! (-> obj local-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj surface-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj coverage) 0.0) (set! (-> obj touch-angle) 0.0) - ;; we want to take a step of 1.0 (let ((f30-0 1.0) (s4-0 0) ;; iterations @@ -1268,48 +900,35 @@ (while (and (< 0.05 f30-0) ;; at least 5% left (and (< s4-0 (the-as int (-> obj max-iteration-count))) ;; iterations left (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ;; nonzero velocity - ) - ) - + )) ;; note that in between step-collision! and update-from-step-szie, the touching list is in an invalid state. (let ((f28-0 (step-collison! obj arg0 arg0 f30-0))) ;; step forward! - (update-from-step-size *touching-list* f28-0) ;; update touching list. - (set! f30-0 (- f30-0 (* f28-0 f30-0))) ;; advance the fraction of the remaining step. + (update-from-step-size *touching-list* f28-0) ;; update touching list. + (set! f30-0 (- f30-0 (* f28-0 f30-0))) ;; advance the fraction of the remaining step. ) - (+! s4-0 1) - ) - ) + (+! s4-0 1))) 0 - (none) - ) + (none)) (defmethod integrate-and-collide! ((obj control-info) (arg0 vector)) "Specialization of integrate and collide for the target" ;; time it (stopwatch-start (-> *collide-stats* total-target)) - ;; check and correct massive velocity. (when (< 1638400.0 (vector-length arg0)) (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) - (vector-reset! arg0) - ) - + (vector-reset! arg0)) ;; ??? (set! (-> obj unknown-vector15 quad) (-> obj unknown-vector14 quad)) (vector-matrix*! (-> obj unknown-vector14) (-> obj unknown-vector13) (-> obj unknown-matrix02)) (vector-! (-> obj unknown-vector16) (-> obj unknown-vector14) (-> obj unknown-vector15)) (let ((a1-6 (vector-! (new 'stack-no-clear 'vector) (-> obj unknown-vector11) (-> obj unknown-vector14)))) - (vector-seek! (-> obj unknown-vector12) a1-6 (* 16384.0 (-> *display* seconds-per-frame))) - ) + (vector-seek! (-> obj unknown-vector12) a1-6 (* 16384.0 (-> *display* seconds-per-frame)))) (let ((s3-1 (vector+float*! (new-stack-vector0) arg0 (-> obj unknown-vector16) 60.0)) - (s4-1 (new 'stack-no-clear 'vector)) - ) + (s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> arg0 quad)) - ;; call the normal integrate. - (let ((t9-7 (method-of-type collide-shape-moving integrate-and-collide!))) - (t9-7 obj s3-1) - ) + (let ((t9-7 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-7 obj s3-1)) (let ((s1-0 (new-stack-vector0))) (set! (-> s1-0 quad) (-> s4-1 quad)) (let ((s2-1 (new-stack-vector0))) @@ -1317,88 +936,46 @@ (let ((s0-0 (new-stack-vector0))) (let ((f0-4 (vector-dot (-> obj dynam gravity-normal) s1-0))) 0.0 - (vector-! s0-0 s1-0 (vector-float*! s0-0 (-> obj dynam gravity-normal) f0-4)) - ) + (vector-! s0-0 s1-0 (vector-float*! s0-0 (-> obj dynam gravity-normal) f0-4))) (let* ((f0-5 (vector-length s0-0)) (f1-2 f0-5) - (f2-0 0.0) - ) - (vector+! - s1-0 - (vector-float*! s1-0 (-> obj dynam gravity-normal) f2-0) - (vector-float*! s0-0 s0-0 (/ f0-5 f1-2)) - ) - ) - ) + (f2-0 0.0)) + (vector+! s1-0 (vector-float*! s1-0 (-> obj dynam gravity-normal) f2-0) (vector-float*! s0-0 s0-0 (/ f0-5 f1-2))))) (let ((s0-1 (new-stack-vector0))) (let ((f0-8 (vector-dot (-> obj dynam gravity-normal) s2-1))) 0.0 - (vector-! s0-1 s2-1 (vector-float*! s0-1 (-> obj dynam gravity-normal) f0-8)) - ) + (vector-! s0-1 s2-1 (vector-float*! s0-1 (-> obj dynam gravity-normal) f0-8))) (let* ((f0-9 (vector-length s0-1)) (f1-4 f0-9) - (f2-1 0.0) - ) - (vector+! - s2-1 - (vector-float*! s2-1 (-> obj dynam gravity-normal) f2-1) - (vector-float*! s0-1 s0-1 (/ f0-9 f1-4)) - ) - ) - ) + (f2-1 0.0)) + (vector+! s2-1 (vector-float*! s2-1 (-> obj dynam gravity-normal) f2-1) (vector-float*! s0-1 s0-1 (/ f0-9 f1-4))))) (vector-normalize! s1-0 1.0) (vector-normalize! s2-1 1.0) (let ((f30-1 (vector-dot s1-0 s2-1))) (cond - ((and (!= (vector-length (-> obj unknown-vector01)) 0.0) (if (logtest? (-> obj status) 8) - (< f30-1 0.9999) - (< f30-1 0.95) - ) - ) + ((and (!= (vector-length (-> obj unknown-vector01)) 0.0) + (if (logtest? (-> obj status) 8) (< f30-1 0.9999) (< f30-1 0.95))) (set! (-> obj unknown-float70) (seek (-> obj unknown-float70) 1.0 (* 4.0 (-> *display* seconds-per-frame)))) - (set! (-> obj unknown-float71) (seek - (-> obj unknown-float71) - (if (= (-> obj unknown-surface00 mode) 'air) - 1.0 - 0.0 - ) - (* 4.0 (-> *display* seconds-per-frame)) - ) - ) - (logior! (-> obj status) 512) - ) + (set! (-> obj unknown-float71) + (seek (-> obj unknown-float71) + (if (= (-> obj unknown-surface00 mode) 'air) 1.0 0.0) + (* 4.0 (-> *display* seconds-per-frame)))) + (logior! (-> obj status) 512)) (else - (set! (-> obj unknown-float70) (seek (-> obj unknown-float70) 0.0 (* 2.0 (-> *display* seconds-per-frame)))) - (set! (-> obj unknown-float71) (seek (-> obj unknown-float71) 0.0 (* 2.0 (-> *display* seconds-per-frame)))) - ) - ) - ) - ) - ) + (set! (-> obj unknown-float70) (seek (-> obj unknown-float70) 0.0 (* 2.0 (-> *display* seconds-per-frame)))) + (set! (-> obj unknown-float71) (seek (-> obj unknown-float71) 0.0 (* 2.0 (-> *display* seconds-per-frame))))))))) (if (logtest? (-> obj status) 1) - (set! (-> arg0 quad) (-> s3-1 quad)) - (vector--float*! arg0 s3-1 (-> obj unknown-vector16) 60.0) - ) + (set! (-> arg0 quad) (-> s3-1 quad)) + (vector--float*! arg0 s3-1 (-> obj unknown-vector16) 60.0)) (if (and (logtest? (-> obj status) 1) - (and (zero? (logand (-> obj status) 520)) (< (vector-length (-> obj unknown-vector61)) (vector-length s4-1))) - ) - (set! (-> obj unknown-vector61 quad) (-> s4-1 quad)) - ) - ) + (and (zero? (logand (-> obj status) 520)) (< (vector-length (-> obj unknown-vector61)) (vector-length s4-1)))) + (set! (-> obj unknown-vector61 quad) (-> s4-1 quad)))) (let ((s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj unknown-vector120) 1.0)) - (f0-32 (vector-length (-> obj unknown-vector120))) - ) - (set! (-> obj unknown-float140) (if (= f0-32 0.0) - 0.0 - (fmax 0.0 (/ (vector-dot (-> obj transv) s5-1) f0-32)) - ) - ) - ) + (f0-32 (vector-length (-> obj unknown-vector120)))) + (set! (-> obj unknown-float140) (if (= f0-32 0.0) 0.0 (fmax 0.0 (/ (vector-dot (-> obj transv) s5-1) f0-32))))) (stopwatch-stop (-> *collide-stats* total-target)) 0 - (none) - ) - + (none)) (defmethod move-to-ground-point! ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) "Move the collide shape to the ground immediately: @@ -1416,8 +993,7 @@ (set! (-> obj ground-impact-vel) (- (vector-dot arg1 (-> obj dynam gravity-normal)))) (set! (-> obj ground-touch-point quad) (-> arg0 quad)) 0 - (none) - ) + (none)) (defmethod integrate-no-collide! ((obj collide-shape-moving) (arg0 vector)) "Integrate, but ignore all collisions. @@ -1425,30 +1001,15 @@ (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) - (vf2 :class vf) - ) + (vf2 :class vf)) (init-vf0-vector) (update-transforms! obj) (set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad)) (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (cshape-moving-flags - onsurf - onground - tsurf - twall - t-ciel - t-act - csmf06 - csmf07 - csmf09 - on-water - csmf11 - csmf12 - csmf13 - ) - ) + (logclear! (-> obj status) + (cshape-moving-flags onsurf onground tsurf twall t-ciel t-act csmf06 csmf07 csmf09 on-water csmf11 csmf12 csmf13)) (set! (-> obj local-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj surface-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad)) @@ -1456,23 +1017,17 @@ (set! (-> obj touch-angle) 0.0) (let* ((a0-12 obj) (t9-1 (method-of-object a0-12 move-by-vector!)) - (a1-1 (new 'stack-no-clear 'vector)) - ) + (a1-1 (new 'stack-no-clear 'vector))) (.lvf vf1 (&-> arg0 quad)) - (let ((f0-2 (-> *display* seconds-per-frame))) - (.mov at-0 f0-2) - ) + (let ((f0-2 (-> *display* seconds-per-frame))) (.mov at-0 f0-2)) (.mov vf2 at-0) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a1-1 quad) vf1) - (t9-1 a0-12 a1-1) - ) + (t9-1 a0-12 a1-1)) (set! (-> obj shadow-pos quad) (-> obj trans quad)) 0 - (none) - ) - ) + (none))) (defmethod collide-shape-moving-method-58 ((obj collide-shape-moving) (arg0 vector)) ;; not sure yet. moves shadow-pos, but possibly not trans. @@ -1482,11 +1037,8 @@ (set! (-> a1-1 tlist) *touching-list*) (when (find-overlapping-shapes obj a1-1) (move-to-point! obj (the-as vector (-> obj trans-old))) - (return #t) - ) - ) - #f - ) + (return #t))) + #f) (defmethod move-to-tri! ((obj collide-shape-moving) (arg0 collide-tri-result) (arg1 vector)) "Move us to tri arg0, at point arg1." @@ -1496,24 +1048,15 @@ (set! (-> obj poly-normal quad) (-> v1-4 quad)) (set! (-> obj surface-normal quad) (-> v1-4 quad)) (set! (-> obj local-normal quad) (-> v1-4 quad)) - (set! (-> obj ground-poly-normal quad) (-> v1-4 quad)) - ) + (set! (-> obj ground-poly-normal quad) (-> v1-4 quad))) (set! (-> obj poly-pat) (-> arg0 pat)) (set! (-> obj cur-pat) (-> arg0 pat)) (set! (-> obj ground-pat) (-> arg0 pat)) (set! (-> obj ground-touch-point quad) (-> arg1 quad)) 0 - (none) - ) + (none)) -(defmethod integrate-for-enemy-with-move-to-ground! ((obj collide-shape-moving) - (arg0 vector) - (arg1 collide-kind) - (arg2 float) - (arg3 symbol) - (arg4 symbol) - (arg5 symbol) - ) +(defmethod integrate-for-enemy-with-move-to-ground! ((obj collide-shape-moving) (arg0 vector) (arg1 collide-kind) (arg2 float) (arg3 symbol) (arg4 symbol) (arg5 symbol)) "This is likely the main method for stepping an enemy. arg0: velocity arg1: ground collision @@ -1525,15 +1068,11 @@ (set! sv-128 arg2) (let ((s5-0 arg3)) (let ((s3-0 arg4) - (s1-0 arg5) - ) + (s1-0 arg5)) (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) - ) + (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80))) ;; move us forward! (integrate-no-collide! obj arg0) ;; set our position to shadow (not sure why) @@ -1545,45 +1084,31 @@ 0.0 ;; probe the ground! (let ((f0-4 (if s1-0 - (misty-ambush-height-probe s0-0 81920.0) - (fill-and-probe-using-line-sphere - *collide-cache* - s0-0 - (new 'static 'vector :y -81920.0 :w 1.0) ;; probe down. - 40.96 - arg1 - (-> obj process) - sv-144 - (new 'static 'pat-surface :noentity #x1) - ) - ) - ) - ) + (misty-ambush-height-probe s0-0 81920.0) + (fill-and-probe-using-line-sphere *collide-cache* + s0-0 + (new 'static 'vector :y -81920.0 :w 1.0) ;; probe down. + 40.96 + arg1 + (-> obj process) + sv-144 + (new 'static 'pat-surface :noentity #x1))))) (cond ((>= f0-4 0.0) ;; found the ground! (let ((a2-3 (new 'static 'vector :y -81920.0 :w 1.0))) ;; set s0-0 to the ground. - (vector+float*! s0-0 s0-0 a2-3 f0-4) - ) + (vector+float*! s0-0 s0-0 a2-3 f0-4)) (when (>= (-> s0-0 y) (-> obj trans y)) ;; we're in the ground, move us out of the ground. (move-to-tri! obj sv-144 s0-0) ;; remember how hard we hit (set! (-> obj ground-impact-vel) (- (vector-dot arg0 (-> obj dynam gravity-normal)))) ;; and kill our vertical velocity. - (set! (-> arg0 y) 0.0) - ) - ) + (set! (-> arg0 y) 0.0))) (s3-0 - ;; no ground. if the hover flag is set, we just hover. - (set! (-> obj trans y) (-> obj trans-old 0 y)) - ) - ) - ) - ) - ) - + ;; no ground. if the hover flag is set, we just hover. + (set! (-> obj trans y) (-> obj trans-old 0 y))))))) ;; if we need to collide with things. (when (logtest? (-> obj root-prim collide-with) (collide-kind cak-1 cak-2 cak-3 target)) (let ((a1-7 (new 'stack-no-clear 'overlaps-others-params))) @@ -1592,71 +1117,52 @@ ;; compute overlaps. (when (find-overlapping-shapes obj a1-7) ;; if we have the revert move if blocked, go back to our old point. - (if s5-0 - (move-to-point! obj (the-as vector (-> obj trans-old))) - ) - ) - ) - ) - ) + (if s5-0 (move-to-point! obj (the-as vector (-> obj trans-old)))))))) (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :g #xff :a #x80) - ) - ) + (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) 'draw (new 'static 'rgba :g #xff :a #x80))) 0 - (none) - ) + (none)) (defmethod move-to-ground ((obj collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-kind)) "Move to the ground now." (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) - ) + (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80))) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s3-0 (new 'stack-no-clear 'collide-tri-result)) - ) + (s3-0 (new 'stack-no-clear 'collide-tri-result))) (let ((f30-0 (+ arg0 arg1))) (set! (-> s4-0 quad) (-> obj trans quad)) (+! (-> s4-0 y) arg0) 0.0 ;; find the ground - (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (new 'static 'pat-surface :noentity #x1)))) + (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* + s4-0 + f30-0 + arg3 + (-> obj process) + s3-0 + (new 'static 'pat-surface :noentity #x1)))) (when (< f0-4 0.0) (if arg2 - (format 0 "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" - (* 0.00024414062 (-> s4-0 y)) - (* 0.00024414062 f30-0) - (-> obj process name) - (-> obj process type symbol) - ) - ) - (return #f) - ) + (format 0 + "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" + (* 0.00024414062 (-> s4-0 y)) + (* 0.00024414062 f30-0) + (-> obj process name) + (-> obj process type symbol))) + (return #f)) ;; calulate the ground position. - (set! (-> s4-0 y) (- (-> s4-0 y) (* f0-4 f30-0))) - ) - ) + (set! (-> s4-0 y) (- (-> s4-0 y) (* f0-4 f30-0))))) ;; move our shadow there too (set! (-> obj shadow-pos quad) (-> s4-0 quad)) ;; and move us there! - (move-to-tri! obj s3-0 s4-0) - ) + (move-to-tri! obj s3-0 s4-0)) (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - ) - ) - #t - ) + (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))) + #t) (defmethod compute-acc-due-to-gravity ((obj collide-shape-moving) (arg0 vector) (arg1 float)) "Compute the acceleration due to gravity." @@ -1666,60 +1172,37 @@ ) ;; apply that. note that we scale the slopiness by arg1 ;; (this is not really how things work.) - (vector--float*! arg0 s4-0 a2-2 (cond - ((logtest? (-> obj status) (cshape-moving-flags onsurf)) - (empty) - arg1 - ) - (else - 0.0 - ) - ) - ) - ) - arg0 - ) + (vector--float*! arg0 + s4-0 + a2-2 + (cond + ((logtest? (-> obj status) (cshape-moving-flags onsurf)) (empty) arg1) + (else 0.0)))) + arg0) (defmethod fill-cache-integrate-and-collide! ((obj collide-shape) (arg0 vector) (arg1 collide-kind)) "Fill the collide cache for the object, integrate, and handle collisions!" (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) - (vf2 :class vf) - ) - (init-vf0-vector) - - ;; scale the velocity, to see how far we can go, at max. - (let ((a0-1 (new 'stack-no-clear 'vector))) - (let ((v1-0 a0-1)) - (.lvf vf1 (&-> arg0 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) - (.mov at-0 f0-0) - ) - (.mov vf2 at-0) - (.mov.vf vf1 vf0 :mask #b1000) - (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-0 quad) vf1) - ) - - ;; add a bonus size if we are target. - (let ((f0-2 (+ (vector-length a0-1) - (if (= (-> obj process type) target) - 4096.0 - 0.0 - ) - ) - ) - ) - ;; and now fill the cache with all things we could hit - (fill-cache-for-shape! obj f0-2 arg1) - ) - ) - ;; do the integration, colliding with stuff in the cache. - (integrate-and-collide! obj arg0) - (none) - ) - ) + (vf2 :class vf)) + (init-vf0-vector) + ;; scale the velocity, to see how far we can go, at max. + (let ((a0-1 (new 'stack-no-clear 'vector))) + (let ((v1-0 a0-1)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (-> *display* seconds-per-frame))) (.mov at-0 f0-0)) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1)) + ;; add a bonus size if we are target. + (let ((f0-2 (+ (vector-length a0-1) (if (= (-> obj process type) target) 4096.0 0.0)))) + ;; and now fill the cache with all things we could hit + (fill-cache-for-shape! obj f0-2 arg1))) + ;; do the integration, colliding with stuff in the cache. + (integrate-and-collide! obj arg0) + (none))) (defmethod fill-cache-for-shape! ((obj collide-shape) (arg0 float) (arg1 collide-kind)) "Fill cache for a box." @@ -1730,19 +1213,13 @@ (fill-using-bounding-box *collide-cache* s5-0 arg1 (-> obj process) (-> obj pat-ignore-mask)) ;; only draw collide cache, if we're the target (when (and *display-collide-cache* (= (-> obj process type) target)) - (debug-draw *collide-cache*) - ;; og:preserve-this added - (add-debug-box #t (bucket-id debug) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)) - ) - ) + (debug-draw *collide-cache*) + ;; og:preserve-this added + (add-debug-box #t (bucket-id debug) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)))) (else - ;; no need. the cache can be empty. - (initialize *collide-cache*) - ) - ) - ) - (none) - ) + ;; no need. the cache can be empty. + (initialize *collide-cache*)))) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bounding box of shape @@ -1752,27 +1229,21 @@ (deftype pc-bounding-box-work (structure) ((reg-vf29 vector :inline) (reg-vf30 vector :inline) - (reg-vf31 vector :inline) - ) - ) + (reg-vf31 vector :inline))) (define *pc-bounding-box-work* (new 'global 'pc-bounding-box-work)) (defmacro save-bounding-box-work () `(begin - (.svf (&-> *pc-bounding-box-work* reg-vf31 quad) vf31) - (.svf (&-> *pc-bounding-box-work* reg-vf30 quad) vf30) - (.svf (&-> *pc-bounding-box-work* reg-vf29 quad) vf29) - ) - ) + (.svf (&-> *pc-bounding-box-work* reg-vf31 quad) vf31) + (.svf (&-> *pc-bounding-box-work* reg-vf30 quad) vf30) + (.svf (&-> *pc-bounding-box-work* reg-vf29 quad) vf29))) (defmacro load-bounding-box-work () `(begin - (.lvf vf29 (&-> *pc-bounding-box-work* reg-vf29 quad)) - (.lvf vf30 (&-> *pc-bounding-box-work* reg-vf30 quad)) - (.lvf vf31 (&-> *pc-bounding-box-work* reg-vf31 quad)) - ) - ) + (.lvf vf29 (&-> *pc-bounding-box-work* reg-vf29 quad)) + (.lvf vf30 (&-> *pc-bounding-box-work* reg-vf30 quad)) + (.lvf vf31 (&-> *pc-bounding-box-work* reg-vf31 quad)))) (defmethod build-bounding-box-for-shape ((obj collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-kind)) "Build a bounding box containing the whole shape. @@ -1781,12 +1252,10 @@ (vf1 :class vf) (vf29 :class vf) (vf30 :class vf) - (vf31 :class vf) - ) + (vf31 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'static 'vector :x 4.096)) - (a0-1 (-> obj root-prim)) - ) + (a0-1 (-> obj root-prim))) (cond ((logtest? (-> a0-1 collide-with) arg2) (.mov vf31 arg1) @@ -1801,22 +1270,11 @@ (.mov.vf vf30 vf0 :mask #b1000) (.svf (&-> arg0 min quad) vf29) (.svf (&-> arg0 max quad) vf30) - (return #t) - ) - (else - (return #f) - ) - ) - (the-as none 0) - ) - (else - (return #f) - ) - ) - ) - (the-as symbol 0) - ) - ) + (return #t)) + (else (return #f))) + (the-as none 0)) + (else (return #f)))) + (the-as symbol 0))) ;; ERROR: Bad vector register dependency: vf31 (defmethod add-to-bounding-box ((obj collide-shape-prim) (arg0 collide-kind)) @@ -1825,17 +1283,14 @@ (vf2 :class vf) (vf29 :class vf) (vf30 :class vf) - (vf31 :class vf) - ) + (vf31 :class vf)) (load-bounding-box-work) (.lvf vf1 (&-> obj prim-core world-sphere quad)) (.add.w.vf vf2 vf31 vf1 :mask #b1) (.add.x.vf vf30 vf1 vf2 :mask #b111) (.sub.x.vf vf29 vf1 vf2 :mask #b111) (save-bounding-box-work) - #t - ) - ) + #t)) (defmethod add-to-bounding-box ((obj collide-shape-prim-group) (arg0 collide-kind)) "Add a group of prims." @@ -1846,13 +1301,11 @@ (vf3 :class vf) (vf30 :class vf) (vf31 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (load-bounding-box-work) ;; this first loop looks for a non-empty group. (let ((s4-0 (-> obj num-prims)) - (s3-0 0) - ) + (s3-0 0)) (label cfg-1) (b! (= s3-0 s4-0) cfg-11 :delay (set! v1-0 (* s3-0 4))) (let ((a0-1 (-> (the-as (pointer collide-shape-prim) (+ v1-0 (the-as int obj))) 19))) @@ -1863,20 +1316,14 @@ (when (add-to-bounding-box a0-1 arg0) (load-bounding-box-work) (empty) - (goto cfg-12) - ) - (load-bounding-box-work) - ) + (goto cfg-12)) + (load-bounding-box-work)) (else - (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) - (.add.w.vf vf2 vf31 vf1 :mask #b1) - (.add.x.vf vf30 vf1 vf2 :mask #b111) - (b! #t cfg-12 :delay (.sub.x.vf vf29 vf1 vf2 :mask #b111)) - (.mov v1-10 vf29) - ) - ) - ) - ) + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf30 vf1 vf2 :mask #b111) + (b! #t cfg-12 :delay (.sub.x.vf vf29 vf1 vf2 :mask #b111)) + (.mov v1-10 vf29))))) ;; and now (b! #t cfg-1 :delay (set! s3-0 (+ s3-0 1))) (label cfg-11) @@ -1892,32 +1339,22 @@ ((= (-> a0-2 type) collide-shape-prim-group) (save-bounding-box-work) (add-to-non-empty-bounding-box (the-as collide-shape-prim-group a0-2) arg0) - (load-bounding-box-work) - ) + (load-bounding-box-work)) (else - (.lvf vf1 (&-> a0-2 prim-core world-sphere quad)) - (.add.w.vf vf2 vf31 vf1 :mask #b1) - (.add.x.vf vf4 vf1 vf2 :mask #b111) - (.sub.x.vf vf3 vf1 vf2 :mask #b111) - (.min.vf vf29 vf29 vf3) - (.max.vf vf30 vf30 vf4) - (.mov v1-19 vf30) - ) - ) - ) - ) - (b! #t cfg-13 :delay (set! s3-1 (+ s3-1 1))) - ) + (.lvf vf1 (&-> a0-2 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf4 vf1 vf2 :mask #b111) + (.sub.x.vf vf3 vf1 vf2 :mask #b111) + (.min.vf vf29 vf29 vf3) + (.max.vf vf30 vf30 vf4) + (.mov v1-19 vf30))))) + (b! #t cfg-13 :delay (set! s3-1 (+ s3-1 1)))) (label cfg-19) (save-bounding-box-work) (return #t) (label cfg-21) (save-bounding-box-work) - v0-1 - ) - ) - ) - ) + v0-1)))) (defmethod add-to-non-empty-bounding-box ((obj collide-shape-prim-group) (arg0 collide-kind)) (local-vars (v1-0 int) (v1-8 float)) @@ -1927,12 +1364,10 @@ (vf3 :class vf) (vf30 :class vf) (vf31 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (load-bounding-box-work) (let ((s4-0 (-> obj num-prims)) - (s3-0 0) - ) + (s3-0 0)) (label cfg-1) (b! (= s3-0 s4-0) cfg-7 :delay (set! v1-0 (* s3-0 4))) (let ((a0-1 (-> (the-as (pointer collide-shape-prim) (+ v1-0 (the-as int obj))) 19))) @@ -1941,28 +1376,20 @@ ((= (-> a0-1 type) collide-shape-prim-group) (save-bounding-box-work) (add-to-non-empty-bounding-box (the-as collide-shape-prim-group a0-1) arg0) - (load-bounding-box-work) - ) + (load-bounding-box-work)) (else - (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) - (.add.w.vf vf2 vf31 vf1 :mask #b1) - (.add.x.vf vf4 vf1 vf2 :mask #b111) - (.sub.x.vf vf3 vf1 vf2 :mask #b111) - (.min.vf vf29 vf29 vf3) - (.max.vf vf30 vf30 vf4) - (.mov v1-8 vf30) - ) - ) - ) - ) - (b! #t cfg-1 :delay (set! s3-0 (+ s3-0 1))) - ) + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf4 vf1 vf2 :mask #b111) + (.sub.x.vf vf3 vf1 vf2 :mask #b111) + (.min.vf vf29 vf29 vf3) + (.max.vf vf30 vf30 vf4) + (.mov v1-8 vf30))))) + (b! #t cfg-1 :delay (set! s3-0 (+ s3-0 1)))) (label cfg-7) (save-bounding-box-work) 0 - (none) - ) - ) + (none))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prim lookup @@ -1970,43 +1397,26 @@ (defmethod find-prim-by-id ((obj collide-shape) (arg0 uint)) "Find a prim in this shape with the given id." - (find-prim-by-id (-> obj root-prim) arg0) - ) + (find-prim-by-id (-> obj root-prim) arg0)) (defmethod find-prim-by-id ((obj collide-shape-prim) (arg0 uint)) "Find a prim in this shape or its children with the given id." (if (= (-> obj prim-id) arg0) ;; it's us! - (return obj) - ) - (the-as collide-shape-prim #f) - ) + (return obj)) + (the-as collide-shape-prim #f)) (defmethod find-prim-by-id ((obj collide-shape-prim-group) (arg0 uint)) "Find a prim in this shape or its children with the given id." (if (= (-> obj prim-id) arg0) ;; it's us - (return obj) - ) + (return obj)) (countdown (s4-0 (-> obj num-prims)) (let ((a0-1 (-> obj prims s4-0))) (cond - ((= (-> a0-1 type) collide-shape-prim-group) - (let ((a0-2 (find-prim-by-id a0-1 arg0))) - (if a0-2 - (return a0-2) - ) - ) - ) + ((= (-> a0-1 type) collide-shape-prim-group) (let ((a0-2 (find-prim-by-id a0-1 arg0))) (if a0-2 (return a0-2)))) (else - ;; just check here, to avoid the virtual call - (if (= (-> a0-1 prim-id) arg0) - (return a0-1) - ) - ) - ) - ) - ) - (the-as collide-shape-prim #f) - ) + ;; just check here, to avoid the virtual call + (if (= (-> a0-1 prim-id) arg0) (return a0-1)))))) + (the-as collide-shape-prim #f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; debug @@ -2014,13 +1424,11 @@ (defun-debug collide-shape-draw-debug-marks () "Draw collision debug." - (add-debug-sphere - (or *display-collision-marks* *display-target-marks*) - (bucket-id debug) - (target-pos 0) - 819.2 - (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - ) + (add-debug-sphere (or *display-collision-marks* *display-target-marks*) + (bucket-id debug) + (target-pos 0) + 819.2 + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (when *display-collision-marks* (let ((v1-4 (-> *collide-player-list* alive-list next0))) *collide-player-list* @@ -2030,18 +1438,11 @@ (if (or (and (not *display-actor-anim*) (not *display-process-anim*)) (or (= (-> (the-as collide-shape s5-1) process) *target*) (name= *display-actor-anim* (-> (the-as collide-shape s5-1) process name)) - (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-1) process)) - ) - ) - (debug-draw (the-as collide-shape s5-1)) - ) - ) + (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-1) process)))) + (debug-draw (the-as collide-shape s5-1)))) (set! v1-4 gp-1) *collide-player-list* - (set! gp-1 (-> gp-1 next0)) - ) - ) - ) + (set! gp-1 (-> gp-1 next0))))) (let ((v1-19 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* (let ((gp-2 (-> v1-19 next0))) @@ -2050,18 +1451,11 @@ (if (or (and (not *display-actor-anim*) (not *display-process-anim*)) (or (= (-> (the-as collide-shape s5-2) process) *target*) (name= *display-actor-anim* (-> (the-as collide-shape s5-2) process name)) - (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-2) process)) - ) - ) - (debug-draw (the-as collide-shape s5-2)) - ) - ) + (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-2) process)))) + (debug-draw (the-as collide-shape s5-2)))) (set! v1-19 gp-2) *collide-hit-by-player-list* - (set! gp-2 (-> gp-2 next0)) - ) - ) - ) + (set! gp-2 (-> gp-2 next0))))) (let ((v1-34 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((gp-3 (-> v1-34 next0))) @@ -2070,18 +1464,11 @@ (if (or (and (not *display-actor-anim*) (not *display-process-anim*)) (or (= (-> (the-as collide-shape s5-3) process) *target*) (name= *display-actor-anim* (-> (the-as collide-shape s5-3) process name)) - (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-3) process)) - ) - ) - (debug-draw (the-as collide-shape s5-3)) - ) - ) + (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-3) process)))) + (debug-draw (the-as collide-shape s5-3)))) (set! v1-34 gp-3) *collide-usually-hit-by-player-list* - (set! gp-3 (-> gp-3 next0)) - ) - ) - ) + (set! gp-3 (-> gp-3 next0))))) (let ((v1-49 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((gp-4 (-> v1-49 next0))) @@ -2090,31 +1477,18 @@ (if (or (and (not *display-actor-anim*) (not *display-process-anim*)) (or (= (-> (the-as collide-shape s5-4) process) *target*) (name= *display-actor-anim* (-> (the-as collide-shape s5-4) process name)) - (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-4) process)) - ) - ) - (debug-draw (the-as collide-shape s5-4)) - ) - ) + (= (ppointer->process *display-process-anim*) (-> (the-as collide-shape s5-4) process)))) + (debug-draw (the-as collide-shape s5-4)))) (set! v1-49 gp-4) *collide-hit-by-others-list* - (set! gp-4 (-> gp-4 next0)) - ) - ) - ) - ) + (set! gp-4 (-> gp-4 next0)))))) 0 - (none) - ) - + (none)) (defmethod debug-draw ((obj collide-shape)) "Draw a collide shape" - (if (sphere-in-view-frustum? (the-as sphere (-> obj root-prim prim-core))) - (debug-draw-world-sphere (-> obj root-prim)) - ) - (none) - ) + (if (sphere-in-view-frustum? (the-as sphere (-> obj root-prim prim-core))) (debug-draw-world-sphere (-> obj root-prim))) + (none)) (define *col-timer* (new 'global 'stopwatch)) @@ -2130,9 +1504,7 @@ (format *stdcon* " frame ~F ms~%" (* 1000.0 (stopwatch-elapsed-seconds *frame-timer*))) (stopwatch-init *col-timer*) (stopwatch-init *frame-timer*) - (stopwatch-begin *frame-timer*) - ) - ) + (stopwatch-begin *frame-timer*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; transform spheres by joints @@ -2142,8 +1514,7 @@ "Update all transforms for this shape. After this is called, you can use the world-spheres." (update-transforms! (-> obj root-prim) (-> obj process)) - #f - ) + #f) (defmethod update-transforms! ((obj collide-shape-prim) (arg0 process-drawable)) "Update our world sphere, and our children's world sphere's too." @@ -2155,14 +1526,11 @@ (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (init-vf0-vector) (let ((a1-1 (-> arg0 node-list)) (v1-0 (-> obj cshape)) - (a0-1 (-> obj transform-index)) - ) - + (a0-1 (-> obj transform-index))) (cond ((nonzero? a1-1) (cond @@ -2175,44 +1543,30 @@ (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b11) (.lvf vf3 (&-> v1-4 vector 1 quad)) (.add.mul.x.vf acc vf2 vf1 acc) - (.lvf vf4 (&-> v1-4 vector 2 quad)) - ) + (.lvf vf4 (&-> v1-4 vector 2 quad))) (.add.mul.y.vf acc vf3 vf1 acc) (.add.mul.z.vf vf1 vf4 vf1 acc :mask #b111) (.mul.vf vf1 vf1 Q :mask #b111) (.svf (&-> obj prim-core world-sphere quad) vf1) - (.mov a0-2 vf1) - ) + (.mov a0-2 vf1)) (else - (when (= a0-1 -2) - (.lvf vf1 (&-> obj local-sphere quad)) - (.lvf vf2 (&-> v1-0 trans quad)) - (.add.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> obj prim-core world-sphere quad) vf1) - (.mov a0-4 vf1) - ) - ) - ) - ) + (when (= a0-1 -2) + (.lvf vf1 (&-> obj local-sphere quad)) + (.lvf vf2 (&-> v1-0 trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> obj prim-core world-sphere quad) vf1) + (.mov a0-4 vf1))))) (else - (when (!= a0-1 -1) - (.lvf vf1 (&-> obj local-sphere quad)) - (.lvf vf2 (&-> v1-0 trans quad)) - (.add.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> obj prim-core world-sphere quad) vf1) - (.mov a0-6 vf1) - ) - ) - ) - ) + (when (!= a0-1 -1) + (.lvf vf1 (&-> obj local-sphere quad)) + (.lvf vf2 (&-> v1-0 trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> obj prim-core world-sphere quad) vf1) + (.mov a0-6 vf1))))) (when (= (-> obj type) collide-shape-prim-group) (countdown (s4-0 (-> (the-as collide-shape-prim-group obj) num-prims)) - (update-transforms! (-> (the-as collide-shape-prim-group obj) prims s4-0) arg0) - ) - #f - ) - ) - ) + (update-transforms! (-> (the-as collide-shape-prim-group obj) prims s4-0) arg0)) + #f))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; move by vector, move to point @@ -2222,15 +1576,13 @@ "Adjust our position by the given vector" (vector+! (-> obj trans) (-> obj trans) arg0) (move-by-vector! (-> obj root-prim) arg0) - (none) - ) + (none)) (defmethod move-by-vector! ((obj collide-shape-prim) (arg0 vector)) "Adjust our position by the given vector" (vector+! (the-as vector (-> obj prim-core)) (the-as vector (-> obj prim-core)) arg0) (set! (-> obj prim-core world-sphere w) (-> obj local-sphere w)) - (none) - ) + (none)) (defmethod move-by-vector! ((obj collide-shape-prim-group) (arg0 vector)) "Adjust our position by the given vector" @@ -2239,27 +1591,16 @@ (countdown (s4-0 (-> obj num-prims)) (let ((a0-2 (-> obj prims s4-0))) (cond - ((= (-> a0-2 type) collide-shape-prim-group) - (move-by-vector! a0-2 arg0) - ) + ((= (-> a0-2 type) collide-shape-prim-group) (move-by-vector! a0-2 arg0)) (else - (vector+! (the-as vector (-> a0-2 prim-core)) (the-as vector (-> a0-2 prim-core)) arg0) - (set! (-> a0-2 prim-core world-sphere w) (-> a0-2 local-sphere w)) - ) - ) - ) - ) - (none) - ) + (vector+! (the-as vector (-> a0-2 prim-core)) (the-as vector (-> a0-2 prim-core)) arg0) + (set! (-> a0-2 prim-core world-sphere w) (-> a0-2 local-sphere w)))))) + (none)) (defmethod move-to-point! ((obj collide-shape) (arg0 vector)) "Move us to exactly the given position." - (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj trans)) - (move-by-vector! obj v1-0) - ) - (none) - ) + (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> obj trans)) (move-by-vector! obj v1-0)) + (none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; construction functions @@ -2267,114 +1608,74 @@ (defmethod set-root-prim! ((obj collide-shape) (arg0 collide-shape-prim)) (set! (-> obj root-prim) arg0) - arg0 - ) + arg0) (defmethod set-collide-with! ((obj collide-shape-prim) (arg0 collide-kind)) (set! (-> obj collide-with) arg0) 0 - (none) - ) + (none)) (defmethod set-collide-with! ((obj collide-shape-prim-group) (arg0 collide-kind)) (set! (-> obj collide-with) arg0) (dotimes (s4-0 (-> obj num-prims)) - (set-collide-with! (-> obj prims s4-0) arg0) - ) + (set-collide-with! (-> obj prims s4-0) arg0)) 0 - (none) - ) + (none)) (defmethod set-collide-as! ((obj collide-shape-prim) (arg0 collide-kind)) (set! (-> obj prim-core collide-as) arg0) 0 - (none) - ) + (none)) (defmethod set-collide-as! ((obj collide-shape-prim-group) (arg0 collide-kind)) (set! (-> obj prim-core collide-as) arg0) (dotimes (s4-0 (-> obj num-prims)) - (set-collide-as! (-> obj prims s4-0) arg0) - ) + (set-collide-as! (-> obj prims s4-0) arg0)) 0 - (none) - ) + (none)) (defmethod set-root-prim-collide-with! ((obj collide-shape) (arg0 collide-kind)) (set-collide-with! (-> obj root-prim) arg0) 0 - (none) - ) + (none)) (defmethod set-root-prim-collide-as! ((obj collide-shape) (arg0 collide-kind)) (set-collide-as! (-> obj root-prim) arg0) 0 - (none) - ) + (none)) (defmethod append-prim ((obj collide-shape-prim-group) (arg0 collide-shape-prim)) (let ((v1-0 (-> obj num-prims))) (cond - ((>= v1-0 (-> obj allocated-prims)) - (format 0 "collide-shape-prim-group::append-prim : Exceeded max # of prims!~%") - ) - (else - (set! (-> obj prims v1-0) arg0) - (set! (-> obj num-prims) (+ v1-0 1)) - ) - ) - ) - (none) - ) + ((>= v1-0 (-> obj allocated-prims)) (format 0 "collide-shape-prim-group::append-prim : Exceeded max # of prims!~%")) + (else (set! (-> obj prims v1-0) arg0) (set! (-> obj num-prims) (+ v1-0 1))))) + (none)) (defmethod find-collision-meshes ((obj collide-shape)) (let ((s5-0 0)) (let ((v1-1 (-> obj process draw))) (when (and (nonzero? v1-1) (-> v1-1 jgeo)) (let ((a1-1 (res-lump-struct (-> v1-1 jgeo extra) 'collide-mesh-group structure))) - (if a1-1 - (set! s5-0 (num-mesh (-> obj root-prim) (the-as collide-shape-prim a1-1))) - ) - ) - ) - ) - (if (nonzero? s5-0) - (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s5-0 (-> obj process name)) - ) - ) - (update-transforms! obj) - ) + (if a1-1 (set! s5-0 (num-mesh (-> obj root-prim) (the-as collide-shape-prim a1-1))))))) + (if (nonzero? s5-0) (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s5-0 (-> obj process name)))) + (update-transforms! obj)) (defmethod num-mesh ((obj collide-shape-prim) (arg0 collide-shape-prim)) (local-vars (v0-0 int)) (return 0) - v0-0 - ) + v0-0) (defmethod num-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim)) (let ((s4-0 (-> obj mesh-id))) (cond ((and (>= s4-0 0) (< s4-0 (length arg0))) (set! (-> obj mesh) (the-as collide-mesh (-> arg0 prim-core world-sphere data s4-0))) - (return 0) - ) - (else - (set! (-> obj mesh) #f) - (return 1) - ) - ) - ) - (the-as int 0) - ) + (return 0)) + (else (set! (-> obj mesh) #f) (return 1)))) + (the-as int 0)) (defmethod num-mesh ((obj collide-shape-prim-group) (arg0 collide-shape-prim)) - (let ((gp-0 0)) - (countdown (s3-0 (-> obj num-prims)) - (+! gp-0 (num-mesh (-> obj prims s3-0) arg0)) - ) - gp-0 - ) - ) + (let ((gp-0 0)) (countdown (s3-0 (-> obj num-prims)) (+! gp-0 (num-mesh (-> obj prims s3-0) arg0))) gp-0)) (defmethod change-mesh ((obj collide-shape-prim-mesh) (arg0 int)) "Change our mesh to the given mesh ID." @@ -2390,27 +1691,14 @@ (set! (-> obj mesh-id) arg0) ;; kill the collide mesh cache. (let* ((v1-11 *collide-mesh-cache*) - (a0-6 (-> v1-11 id)) - ) + (a0-6 (-> v1-11 id))) (set! (-> v1-11 used-size) (the-as uint 0)) (let ((v0-5 (the-as int (+ a0-6 1)))) (b! (zero? (the-as uint v0-5)) cfg-12 :likely-delay (set! v0-5 1)) (label cfg-12) - (set! (-> v1-11 id) (the-as uint v0-5)) - ) - ) - ) - (else - (format 0 "ERROR: ~%~%collide-shape-prim-mesh::change-mesh(): Failed to find collision mesh!~%") - ) - ) - ) - ) - ) - ) - ) - (none) - ) + (set! (-> v1-11 id) (the-as uint v0-5))))) + (else (format 0 "ERROR: ~%~%collide-shape-prim-mesh::change-mesh(): Failed to find collision mesh!~%")))))))) + (none)) (defmethod init! ((obj collide-shape-intersect) (arg0 vector)) "Initialize the intersection in the given direction." @@ -2418,103 +1706,67 @@ (set! (-> obj best-u) -100000000.0) (set! (-> obj best-from-prim) #f) (set! (-> obj best-to-prim) #f) - #f - ) + #f) (defmethod debug-draw-world-sphere ((obj collide-shape-prim)) "Draw our sphere" - (add-debug-sphere - #t - (bucket-id debug) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) - (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) - ) - ) + (add-debug-sphere #t + (bucket-id debug) + (the-as vector (-> obj prim-core)) + (-> obj local-sphere w) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40))) (defmethod debug-draw-world-sphere ((obj collide-shape-prim-sphere)) "Draw our sphere" - (add-debug-sphere - #t - (bucket-id debug) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) - (cond - ((and (zero? (-> obj prim-core collide-as)) (zero? (-> obj collide-with))) - (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) - ) - ((logtest? (-> obj prim-core action) (collide-action solid)) - (new 'static 'rgba :r #xff :g #xff :a #x40) - ) - (else - (new 'static 'rgba :r #xff :g #x80 :a #x40) - ) - ) - ) - ) + (add-debug-sphere #t + (bucket-id debug) + (the-as vector (-> obj prim-core)) + (-> obj local-sphere w) + (cond + ((and (zero? (-> obj prim-core collide-as)) (zero? (-> obj collide-with))) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)) + ((logtest? (-> obj prim-core action) (collide-action solid)) (new 'static 'rgba :r #xff :g #xff :a #x40)) + (else (new 'static 'rgba :r #xff :g #x80 :a #x40))))) (defmethod debug-draw-world-sphere ((obj collide-shape-prim-mesh)) "Draw our sphere" - (add-debug-sphere - #t - (bucket-id debug) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) - (new 'static 'rgba :b #xff :a #x40) - ) - ) + (add-debug-sphere #t + (bucket-id debug) + (the-as vector (-> obj prim-core)) + (-> obj local-sphere w) + (new 'static 'rgba :b #xff :a #x40))) (defmethod debug-draw-world-sphere ((obj collide-shape-prim-group)) "Draw our sphere" - (add-debug-sphere - #t - (bucket-id debug) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) - (new 'static 'rgba :g #xff :a #x10) - ) + (add-debug-sphere #t + (bucket-id debug) + (the-as vector (-> obj prim-core)) + (-> obj local-sphere w) + (new 'static 'rgba :g #xff :a #x10)) (countdown (s5-0 (-> obj num-prims)) - (debug-draw-world-sphere (-> obj prims s5-0)) - ) - #f - ) + (debug-draw-world-sphere (-> obj prims s5-0))) + #f) (defmethod do-push-aways! ((obj collide-shape)) "This is the main function to call to respond" - (local-vars - (at-0 int) - (at-1 int) - (at-2 int) - (at-3 int) - (v1-20 int) - (v1-53 int) - (v1-85 int) - (v1-116 int) - ) + (local-vars (at-0 int) (at-1 int) (at-2 int) (at-3 int) (v1-20 int) (v1-53 int) (v1-85 int) (v1-116 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) - (vf5 :class vf) - ) + (vf5 :class vf)) (init-vf0-vector) - ;; kill the mesh cache (let* ((v1-0 *collide-mesh-cache*) - (a0-1 (-> v1-0 id)) - ) + (a0-1 (-> v1-0 id))) (set! (-> v1-0 used-size) (the-as uint 0)) (let ((a0-2 (the-as int (+ a0-1 1)))) (b! (zero? (the-as uint a0-2)) cfg-2 :likely-delay (set! a0-2 1)) (label cfg-2) - (set! (-> v1-0 id) (the-as uint a0-2)) - ) - ) - + (set! (-> v1-0 id) (the-as uint a0-2)))) ;; loop over everything! (let ((s5-0 (-> obj root-prim collide-with))) - ;; we collide with target, so check the player list. (when (logtest? s5-0 (collide-kind target)) (let ((v1-5 (-> *collide-player-list* alive-list next0))) @@ -2536,26 +1788,17 @@ (let ((s1-0 (new 'stack-no-clear 'vector))) (let ((v1-19 (new 'stack-no-clear 'vector))) (set! (-> v1-19 quad) (-> s3-0 trans quad)) - ;; this is... a bit of a hack. ;; this adjusts our collision to be within 0.7 - 1.4m of our base. ;; (note, this only applies for intermediate iterations of this loop) (let* ((f1-2 (+ 2867.2 (-> v1-19 y))) ;; f1-2 = 0.7 m above use - (f2-0 (+ 5734.4 f1-2)) ;; 1.4m above us - (f0-3 (-> s2-0 best-from-tri intersect y)) - ) + (f2-0 (+ 5734.4 f1-2)) ;; 1.4m above us + (f0-3 (-> s2-0 best-from-tri intersect y))) (cond - ((< f0-3 f1-2) - (set! f0-3 f1-2) - ) - ((< f2-0 f0-3) - (set! f0-3 f2-0) - ) - ) - (set! (-> v1-19 y) f0-3) - ) - (.lvf vf4 (&-> v1-19 quad)) - ) + ((< f0-3 f1-2) (set! f0-3 f1-2)) + ((< f2-0 f0-3) (set! f0-3 f2-0))) + (set! (-> v1-19 y) f0-3)) + (.lvf vf4 (&-> v1-19 quad))) (.lvf vf3 (&-> s2-0 best-from-tri intersect quad)) (.lvf vf5 (&-> s2-0 best-from-tri normal quad)) (.sub.vf vf2 vf4 vf3) @@ -2570,40 +1813,21 @@ (vector-float*! s1-0 s1-0 (- (-> s2-0 best-dist))) (let ((v1-23 s1-0)) (.lvf vf1 (&-> s1-0 quad)) - (let ((f0-6 (-> *display* frames-per-second))) - (.mov at-0 f0-6) - ) + (let ((f0-6 (-> *display* frames-per-second))) (.mov at-0 f0-6)) (.mov vf2 at-0) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-23 quad) vf1) - ) + (.svf (&-> v1-23 quad) vf1)) (let ((s0-0 (-> s3-0 status))) ;; step. (integrate-and-collide! s3-0 s1-0) - (set! (-> s3-0 status) s0-0) - ) - ) - (+! s5-1 -1) - ) - ) - (set! s5-0 (-> obj root-prim collide-with)) - ) - ) - ) - ) - ) + (set! (-> s3-0 status) s0-0))) + (+! s5-1 -1))) + (set! s5-0 (-> obj root-prim collide-with))))))) (set! v1-5 s4-0) *collide-player-list* - (set! s4-0 (-> s4-0 next0)) - ) - ) - ) - ) - - + (set! s4-0 (-> s4-0 next0)))))) (when (logtest? s5-0 (collide-kind cak-1 cak-2 cak-3)) - (when (logtest? s5-0 (collide-kind cak-1)) (let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0))) *collide-hit-by-player-list* @@ -2622,20 +1846,12 @@ (set! (-> v1-52 quad) (-> s3-1 trans quad)) (let* ((f1-5 (+ 2867.2 (-> v1-52 y))) (f2-1 (+ 5734.4 f1-5)) - (f0-10 (-> s2-1 best-from-tri intersect y)) - ) + (f0-10 (-> s2-1 best-from-tri intersect y))) (cond - ((< f0-10 f1-5) - (set! f0-10 f1-5) - ) - ((< f2-1 f0-10) - (set! f0-10 f2-1) - ) - ) - (set! (-> v1-52 y) f0-10) - ) - (.lvf vf4 (&-> v1-52 quad)) - ) + ((< f0-10 f1-5) (set! f0-10 f1-5)) + ((< f2-1 f0-10) (set! f0-10 f2-1))) + (set! (-> v1-52 y) f0-10)) + (.lvf vf4 (&-> v1-52 quad))) (.lvf vf3 (&-> s2-1 best-from-tri intersect quad)) (.lvf vf5 (&-> s2-1 best-from-tri normal quad)) (.sub.vf vf2 vf4 vf3) @@ -2650,37 +1866,17 @@ (vector-float*! s1-1 s1-1 (- (-> s2-1 best-dist))) (let ((v1-56 s1-1)) (.lvf vf1 (&-> s1-1 quad)) - (let ((f0-13 (-> *display* frames-per-second))) - (.mov at-1 f0-13) - ) + (let ((f0-13 (-> *display* frames-per-second))) (.mov at-1 f0-13)) (.mov vf2 at-1) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-56 quad) vf1) - ) - (let ((s0-1 (-> s3-1 status))) - (integrate-and-collide! s3-1 s1-1) - (set! (-> s3-1 status) s0-1) - ) - ) - (+! s5-2 -1) - ) - ) - (set! s5-0 (-> obj root-prim collide-with)) - ) - ) - ) - ) - ) + (.svf (&-> v1-56 quad) vf1)) + (let ((s0-1 (-> s3-1 status))) (integrate-and-collide! s3-1 s1-1) (set! (-> s3-1 status) s0-1))) + (+! s5-2 -1))) + (set! s5-0 (-> obj root-prim collide-with))))))) (set! v1-38 s4-1) *collide-hit-by-player-list* - (set! s4-1 (-> s4-1 next0)) - ) - ) - ) - ) - - + (set! s4-1 (-> s4-1 next0)))))) (when (logtest? s5-0 (collide-kind cak-2)) (let ((v1-70 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* @@ -2699,20 +1895,12 @@ (set! (-> v1-84 quad) (-> s3-2 trans quad)) (let* ((f1-8 (+ 2867.2 (-> v1-84 y))) (f2-2 (+ 5734.4 f1-8)) - (f0-17 (-> s2-2 best-from-tri intersect y)) - ) + (f0-17 (-> s2-2 best-from-tri intersect y))) (cond - ((< f0-17 f1-8) - (set! f0-17 f1-8) - ) - ((< f2-2 f0-17) - (set! f0-17 f2-2) - ) - ) - (set! (-> v1-84 y) f0-17) - ) - (.lvf vf4 (&-> v1-84 quad)) - ) + ((< f0-17 f1-8) (set! f0-17 f1-8)) + ((< f2-2 f0-17) (set! f0-17 f2-2))) + (set! (-> v1-84 y) f0-17)) + (.lvf vf4 (&-> v1-84 quad))) (.lvf vf3 (&-> s2-2 best-from-tri intersect quad)) (.lvf vf5 (&-> s2-2 best-from-tri normal quad)) (.sub.vf vf2 vf4 vf3) @@ -2727,35 +1915,17 @@ (vector-float*! s1-2 s1-2 (- (-> s2-2 best-dist))) (let ((v1-88 s1-2)) (.lvf vf1 (&-> s1-2 quad)) - (let ((f0-20 (-> *display* frames-per-second))) - (.mov at-2 f0-20) - ) + (let ((f0-20 (-> *display* frames-per-second))) (.mov at-2 f0-20)) (.mov vf2 at-2) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-88 quad) vf1) - ) - (let ((s0-2 (-> s3-2 status))) - (integrate-and-collide! s3-2 s1-2) - (set! (-> s3-2 status) s0-2) - ) - ) - (+! s5-3 -1) - ) - ) - (set! s5-0 (-> obj root-prim collide-with)) - ) - ) - ) - ) - ) + (.svf (&-> v1-88 quad) vf1)) + (let ((s0-2 (-> s3-2 status))) (integrate-and-collide! s3-2 s1-2) (set! (-> s3-2 status) s0-2))) + (+! s5-3 -1))) + (set! s5-0 (-> obj root-prim collide-with))))))) (set! v1-70 s4-2) *collide-usually-hit-by-player-list* - (set! s4-2 (-> s4-2 next0)) - ) - ) - ) - ) + (set! s4-2 (-> s4-2 next0)))))) (when (logtest? s5-0 (collide-kind cak-3)) (let ((v1-101 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* @@ -2774,20 +1944,12 @@ (set! (-> v1-115 quad) (-> s3-3 trans quad)) (let* ((f1-11 (+ 2867.2 (-> v1-115 y))) (f2-3 (+ 5734.4 f1-11)) - (f0-24 (-> s2-3 best-from-tri intersect y)) - ) + (f0-24 (-> s2-3 best-from-tri intersect y))) (cond - ((< f0-24 f1-11) - (set! f0-24 f1-11) - ) - ((< f2-3 f0-24) - (set! f0-24 f2-3) - ) - ) - (set! (-> v1-115 y) f0-24) - ) - (.lvf vf4 (&-> v1-115 quad)) - ) + ((< f0-24 f1-11) (set! f0-24 f1-11)) + ((< f2-3 f0-24) (set! f0-24 f2-3))) + (set! (-> v1-115 y) f0-24)) + (.lvf vf4 (&-> v1-115 quad))) (.lvf vf3 (&-> s2-3 best-from-tri intersect quad)) (.lvf vf5 (&-> s2-3 best-from-tri normal quad)) (.sub.vf vf2 vf4 vf3) @@ -2802,40 +1964,18 @@ (vector-float*! s1-3 s1-3 (- (-> s2-3 best-dist))) (let ((v1-119 s1-3)) (.lvf vf1 (&-> s1-3 quad)) - (let ((f0-27 (-> *display* frames-per-second))) - (.mov at-3 f0-27) - ) + (let ((f0-27 (-> *display* frames-per-second))) (.mov at-3 f0-27)) (.mov vf2 at-3) (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-119 quad) vf1) - ) - (let ((s0-3 (-> s3-3 status))) - (integrate-and-collide! s3-3 s1-3) - (set! (-> s3-3 status) s0-3) - ) - ) - (+! s5-4 -1) - ) - ) - (set! s5-0 (-> obj root-prim collide-with)) - ) - ) - ) - ) - ) + (.svf (&-> v1-119 quad) vf1)) + (let ((s0-3 (-> s3-3 status))) (integrate-and-collide! s3-3 s1-3) (set! (-> s3-3 status) s0-3))) + (+! s5-4 -1))) + (set! s5-0 (-> obj root-prim collide-with))))))) (set! v1-101 s4-3) *collide-hit-by-others-list* - (set! s4-3 (-> s4-3 next0)) - ) - ) - ) - #f - ) - ) - ) - ) - ) + (set! s4-3 (-> s4-3 next0))))) + #f))))) ;;;;;;;;;;;;;;;;;;;;;;; ;; overlap test @@ -2863,26 +2003,21 @@ (a3-7 uint) (a3-9 float) (a3-10 uint) - (s2-0 symbol) - ) + (s2-0 symbol)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (init-vf0-vector) (let* ((v1-0 *collide-mesh-cache*) - (a0-1 (-> v1-0 id)) - ) + (a0-1 (-> v1-0 id))) (set! (-> v1-0 used-size) (the-as uint 0)) (let ((a0-2 (the-as int (+ a0-1 1)))) (b! (zero? (the-as uint a0-2)) cfg-2 :likely-delay (set! a0-2 1)) (label cfg-2) - (set! (-> v1-0 id) (the-as uint a0-2)) - ) - ) + (set! (-> v1-0 id) (the-as uint a0-2)))) (let ((s3-0 (the-as object #f))) (let ((s4-0 (-> obj root-prim))) (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) @@ -2893,8 +2028,7 @@ (let ((s1-0 (-> a0-6 next0))) (while (!= a0-6 (-> *collide-player-list* alive-list-end)) (let* ((a0-7 (the-as collide-shape-moving (-> (the-as connection a0-6) param1))) - (a2-0 (-> a0-7 root-prim)) - ) + (a2-0 (-> a0-7 root-prim))) (when (logtest? v1-1 (-> a2-0 prim-core collide-as)) (.lvf vf2 (&-> a2-0 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) @@ -2911,10 +2045,7 @@ (.mov a3-0 vf3) (let ((a0-8 (-> a0-7 process))) (b! (< f0-0 a3-0) cfg-13 :delay (set! a3-1 (-> arg0 options))) - (b! (= a1-6 a0-8) cfg-13 :delay (set! a0-9 (logand a3-1 2))) - ) - ) - ) + (b! (= a1-6 a0-8) cfg-13 :delay (set! a0-9 (logand a3-1 2)))))) (b! (zero? a0-9) cfg-10 :delay (set! a0-10 (-> arg0 tlist))) (b! (= a0-10 #f) cfg-11 :delay (set! v1-2 #t)) (set! s2-0 v1-2) @@ -2927,15 +2058,10 @@ (b! (= s2-0 #f) cfg-13 :delay (set! v1-1 (-> s4-0 collide-with))) (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) (label cfg-13) - 0 - ) - ) + 0)) (set! a0-6 s1-0) *collide-player-list* - (set! s1-0 (-> s1-0 next0)) - ) - ) - ) + (set! s1-0 (-> s1-0 next0))))) (label cfg-17) (when (logtest? v1-1 (collide-kind cak-1 cak-2 cak-3)) (when (logtest? v1-1 (collide-kind cak-1)) @@ -2944,8 +2070,7 @@ (let ((s1-1 (-> a0-21 next0))) (while (!= a0-21 (-> *collide-hit-by-player-list* alive-list-end)) (let* ((a0-22 (the-as collide-shape-moving (-> (the-as connection a0-21) param1))) - (a2-1 (-> a0-22 root-prim)) - ) + (a2-1 (-> a0-22 root-prim))) (when (logtest? v1-1 (-> a2-1 prim-core collide-as)) (.lvf vf2 (&-> a2-1 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) @@ -2962,10 +2087,7 @@ (.mov a3-3 vf3) (let ((a0-23 (-> a0-22 process))) (b! (< f0-1 a3-3) cfg-29 :delay (set! a3-4 (-> arg0 options))) - (b! (= a1-18 a0-23) cfg-29 :delay (set! a0-24 (logand a3-4 2))) - ) - ) - ) + (b! (= a1-18 a0-23) cfg-29 :delay (set! a0-24 (logand a3-4 2)))))) (b! (zero? a0-24) cfg-26 :delay (set! a0-25 (-> arg0 tlist))) (b! (= a0-25 #f) cfg-27 :delay (set! v1-7 #t)) (set! s2-0 v1-7) @@ -2978,24 +2100,17 @@ (b! (= s2-0 #f) cfg-29 :delay (set! v1-1 (-> s4-0 collide-with))) (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) (label cfg-29) - 0 - ) - ) + 0)) (set! a0-21 s1-1) *collide-hit-by-player-list* - (set! s1-1 (-> s1-1 next0)) - ) - ) - ) - ) + (set! s1-1 (-> s1-1 next0)))))) (when (logtest? v1-1 (collide-kind cak-2)) (let ((a0-34 (-> *collide-usually-hit-by-player-list* alive-list next0))) *collide-usually-hit-by-player-list* (let ((s1-2 (-> a0-34 next0))) (while (!= a0-34 (-> *collide-usually-hit-by-player-list* alive-list-end)) (let* ((a0-35 (the-as collide-shape-moving (-> (the-as connection a0-34) param1))) - (a2-2 (-> a0-35 root-prim)) - ) + (a2-2 (-> a0-35 root-prim))) (when (logtest? v1-1 (-> a2-2 prim-core collide-as)) (.lvf vf2 (&-> a2-2 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) @@ -3012,10 +2127,7 @@ (.mov a3-6 vf3) (let ((a0-36 (-> a0-35 process))) (b! (< f0-2 a3-6) cfg-44 :delay (set! a3-7 (-> arg0 options))) - (b! (= a1-30 a0-36) cfg-44 :delay (set! a0-37 (logand a3-7 2))) - ) - ) - ) + (b! (= a1-30 a0-36) cfg-44 :delay (set! a0-37 (logand a3-7 2)))))) (b! (zero? a0-37) cfg-41 :delay (set! a0-38 (-> arg0 tlist))) (b! (= a0-38 #f) cfg-42 :delay (set! v1-12 #t)) (set! s2-0 v1-12) @@ -3028,24 +2140,17 @@ (b! (= s2-0 #f) cfg-44 :delay (set! v1-1 (-> s4-0 collide-with))) (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) (label cfg-44) - 0 - ) - ) + 0)) (set! a0-34 s1-2) *collide-usually-hit-by-player-list* - (set! s1-2 (-> s1-2 next0)) - ) - ) - ) - ) + (set! s1-2 (-> s1-2 next0)))))) (when (logtest? v1-1 (collide-kind cak-3)) (let ((a0-47 (-> *collide-hit-by-others-list* alive-list next0))) *collide-hit-by-others-list* (let ((s1-3 (-> a0-47 next0))) (while (!= a0-47 (-> *collide-hit-by-others-list* alive-list-end)) (let* ((a0-48 (the-as collide-shape-moving (-> (the-as connection a0-47) param1))) - (a2-3 (-> a0-48 root-prim)) - ) + (a2-3 (-> a0-48 root-prim))) (when (logtest? v1-1 (-> a2-3 prim-core collide-as)) (.lvf vf2 (&-> a2-3 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) @@ -3062,10 +2167,7 @@ (.mov a3-9 vf3) (let ((a0-49 (-> a0-48 process))) (b! (< f0-3 a3-9) cfg-59 :delay (set! a3-10 (-> arg0 options))) - (b! (= a1-42 a0-49) cfg-59 :delay (set! a0-50 (logand a3-10 2))) - ) - ) - ) + (b! (= a1-42 a0-49) cfg-59 :delay (set! a0-50 (logand a3-10 2)))))) (b! (zero? a0-50) cfg-56 :delay (set! a0-51 (-> arg0 tlist))) (b! (= a0-51 #f) cfg-57 :delay (set! v1-17 #t)) (set! s2-0 v1-17) @@ -3078,33 +2180,19 @@ (b! (= s2-0 #f) cfg-59 :delay (set! v1-1 (-> s4-0 collide-with))) (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) (label cfg-59) - 0 - ) - ) + 0)) (set! a0-47 s1-3) *collide-hit-by-others-list* - (set! s1-3 (-> s1-3 next0)) - ) - ) - ) - ) - ) - ) - ) + (set! s1-3 (-> s1-3 next0))))))))) (label cfg-63) (b! (= (the-as int s3-0) #f) cfg-65 :delay (nop!)) (set! s3-0 #t) (label cfg-65) - (the-as symbol s3-0) - ) - ) - ) + (the-as symbol s3-0)))) (defmethod overlaps-others-test ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") - #f - ) - + #f) (defmethod overlaps-others-test ((obj collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (a1-3 float)) @@ -3113,13 +2201,11 @@ (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (init-vf0-vector) (let ((s4-0 (-> obj prims)) (s3-0 (-> obj num-prims-u)) - (s2-0 (the-as object #f)) - ) + (s2-0 (the-as object #f))) (let ((v1-0 (-> arg1 prim-core collide-as))) (nop!) (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) @@ -3130,8 +2216,7 @@ (set! s4-0 (&-> s4-0 1)) (let ((a1-2 (logand (-> a0-1 collide-with) v1-0))) (.lvf vf2 (&-> a0-1 prim-core world-sphere quad)) - (b! (zero? a1-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) - ) + (b! (zero? a1-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1))) (.add.w.vf vf4 vf2 vf1 :mask #b1000) (.mul.vf vf3 vf3 vf3 :mask #b111) (.mul.w.vf vf4 vf4 vf4 :mask #b1000) @@ -3139,27 +2224,16 @@ (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) (.sub.w.vf vf3 vf3 vf4 :mask #b1000) - (let ((f0-0 0.0)) - (.add.w.vf vf3 vf0 vf3 :mask #b1) - (.mov a1-3 vf3) - (b! (< f0-0 a1-3) cfg-1) - ) + (let ((f0-0 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a1-3 vf3) (b! (< f0-0 a1-3) cfg-1)) (let ((a0-2 (overlaps-others-test a0-1 arg0 arg1))) (set! v1-0 (-> arg1 prim-core collide-as)) - (b! (= a0-2 #f) cfg-1 :delay (.lvf vf1 (&-> arg1 prim-core world-sphere quad))) - ) - ) - ) + (b! (= a0-2 #f) cfg-1 :delay (.lvf vf1 (&-> arg1 prim-core world-sphere quad)))))) (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) (label cfg-6) (b! (= (the-as int s2-0) #f) cfg-8 :delay (nop!)) (set! s2-0 #t) (label cfg-8) - (the-as symbol s2-0) - ) - ) - ) - + (the-as symbol s2-0)))) (defmethod overlaps-others-group ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) "Overlap, from group." @@ -3169,13 +2243,11 @@ (vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) + (vf4 :class vf)) (init-vf0-vector) (let ((s4-0 (-> arg1 prims)) (s3-0 (-> arg1 num-prims-u)) - (s2-0 (the-as object #f)) - ) + (s2-0 (the-as object #f))) (let ((v1-0 (-> obj collide-with))) (nop!) (.lvf vf2 (&-> obj prim-core world-sphere quad)) @@ -3186,8 +2258,7 @@ (set! s4-0 (&-> s4-0 1)) (let ((a0-2 (logand v1-0 (-> a2-1 prim-core collide-as)))) (.lvf vf1 (&-> a2-1 prim-core world-sphere quad)) - (b! (zero? a0-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) - ) + (b! (zero? a0-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1))) (.add.w.vf vf4 vf2 vf1 :mask #b1000) (.mul.vf vf3 vf3 vf3 :mask #b111) (.mul.w.vf vf4 vf4 vf4 :mask #b1000) @@ -3195,26 +2266,16 @@ (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) (.sub.w.vf vf3 vf3 vf4 :mask #b1000) - (let ((f0-0 0.0)) - (.add.w.vf vf3 vf0 vf3 :mask #b1) - (.mov a0-3 vf3) - (b! (< f0-0 a0-3) cfg-1) - ) + (let ((f0-0 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a0-3 vf3) (b! (< f0-0 a0-3) cfg-1)) (let ((a0-5 (overlaps-others-test obj arg0 a2-1))) (set! v1-0 (-> obj collide-with)) - (b! (= a0-5 #f) cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) - ) - ) - ) + (b! (= a0-5 #f) cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad)))))) (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) (label cfg-6) (b! (= (the-as int s2-0) #f) cfg-8 :delay (nop!)) (set! s2-0 #t) (label cfg-8) - (the-as symbol s2-0) - ) - ) - ) + (the-as symbol s2-0)))) (defmethod overlaps-others-test ((obj collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-26 collide-action)) @@ -3229,46 +2290,31 @@ (let ((s3-0 (-> (the-as collide-shape-prim-mesh arg1) mesh))) (b! (not s3-0) cfg-13) (let ((s2-0 *collide-mesh-cache*)) - (let ((v1-4 (-> s2-0 id))) - (b! (= (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) v1-4) cfg-10) - ) + (let ((v1-4 (-> s2-0 id))) (b! (= (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) v1-4) cfg-10)) (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) (b! (not v1-8) cfg-8 :delay (nop!)) - (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris) - (the-as (inline-array collide-mesh-cache-tri) v1-8) - ) - ) - (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) (-> s2-0 id)) - ) - (populate-cache! - s3-0 - (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) - (-> (the-as collide-shape-prim-mesh arg1) - cshape - process - node-list - data - (-> (the-as collide-shape-prim-mesh arg1) transform-index) - bone - transform - ) - ) + (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8))) + (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) (-> s2-0 id))) + (populate-cache! s3-0 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) + (-> (the-as collide-shape-prim-mesh arg1) + cshape + process + node-list + data + (-> (the-as collide-shape-prim-mesh arg1) transform-index) + bone + transform)) (b! #t cfg-10 :delay (nop!)) (label cfg-8) (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (the-as none 0) (label cfg-10) - (b! - (not (overlap-test - s3-0 - (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) - (the-as vector (-> obj prim-core)) - ) - ) - cfg-13 - ) - ) + (b! (not (overlap-test s3-0 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) + (the-as vector (-> obj prim-core)))) + cfg-13)) (b! #t cfg-14 :delay (nop!)) (the-as none 0) (label cfg-13) @@ -3277,22 +2323,17 @@ (label cfg-14) (let ((a0-6 (-> arg0 tlist))) (b! (= a0-6 #f) cfg-16 :delay (nop!)) - (add-touching-prims a0-6 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) - ) + (add-touching-prims a0-6 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f))) (label cfg-16) (b! (not (logtest? (-> arg0 options) 1)) cfg-19 :delay (set! v1-26 (-> obj prim-core action))) (let ((a0-7 (-> arg1 prim-core action))) - (b! (logtest? (logand v1-26 (collide-action solid)) a0-7) cfg-19 :delay (nop!)) - ) + (b! (logtest? (logand v1-26 (collide-action solid)) a0-7) cfg-19 :delay (nop!))) (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (label cfg-19) (set! v0-1 #t) (label cfg-20) - v0-1 - ) - ) - ) + v0-1))) (defmethod overlaps-others-test ((obj collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-26 collide-action)) @@ -3305,138 +2346,87 @@ (let ((s3-0 (-> obj mesh))) (b! (not s3-0) cfg-12) (let ((s2-0 *collide-mesh-cache*)) - (let ((v1-4 (-> s2-0 id))) - (b! (= (-> obj mesh-cache-id) v1-4) cfg-9) - ) + (let ((v1-4 (-> s2-0 id))) (b! (= (-> obj mesh-cache-id) v1-4) cfg-9)) (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) (b! (not v1-8) cfg-7 :delay (nop!)) - (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8)) - ) - (set! (-> obj mesh-cache-id) (-> s2-0 id)) - ) - (populate-cache! - s3-0 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - (-> obj cshape process node-list data (-> obj transform-index) bone transform) - ) + (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8))) + (set! (-> obj mesh-cache-id) (-> s2-0 id))) + (populate-cache! s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (-> obj cshape process node-list data (-> obj transform-index) bone transform)) (b! #t cfg-9 :delay (nop!)) (label cfg-7) (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (the-as none 0) (label cfg-9) - (b! - (not (overlap-test - s3-0 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - (the-as vector (-> arg1 prim-core)) - ) - ) - cfg-12 - ) - ) + (b! (not (overlap-test s3-0 (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) (the-as vector (-> arg1 prim-core)))) + cfg-12)) (b! #t cfg-14 :delay (nop!)) (the-as none 0) (label cfg-12) (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (label cfg-13) - (format - 0 - "ERROR: Unsupported mesh -> mesh test attempted in collide-shape-prim-mesh::overlaps-others-test!~%" - ) + (format 0 "ERROR: Unsupported mesh -> mesh test attempted in collide-shape-prim-mesh::overlaps-others-test!~%") (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (label cfg-14) (let ((a0-7 (-> arg0 tlist))) (b! (= a0-7 #f) cfg-16 :delay (nop!)) - (add-touching-prims a0-7 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) - ) + (add-touching-prims a0-7 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f))) (label cfg-16) (b! (not (logtest? (-> arg0 options) 1)) cfg-19 :delay (set! v1-26 (-> obj prim-core action))) (let ((a0-8 (-> arg1 prim-core action))) - (b! (logtest? (logand v1-26 (collide-action solid)) a0-8) cfg-19 :delay (nop!)) - ) + (b! (logtest? (logand v1-26 (collide-action solid)) a0-8) cfg-19 :delay (nop!))) (set! v0-1 #f) (b! #t cfg-20 :delay (nop!)) (label cfg-19) (set! v0-1 #t) (label cfg-20) - v0-1 - ) - ) - ) + v0-1))) (defmethod clear-collide-with-as ((obj collide-shape)) (set! (-> obj root-prim collide-with) (collide-kind)) (set! (-> obj root-prim prim-core collide-as) (collide-kind)) 0 - (none) - ) + (none)) (defmethod backup-collide-with-as ((obj collide-shape)) (set! (-> obj backup-collide-with) (-> obj root-prim collide-with)) (set! (-> obj backup-collide-as) (-> obj root-prim prim-core collide-as)) 0 - (none) - ) + (none)) (defmethod restore-collide-with-as ((obj collide-shape)) (set! (-> obj root-prim collide-with) (-> obj backup-collide-with)) (set! (-> obj root-prim prim-core collide-as) (-> obj backup-collide-as)) 0 - (none) - ) + (none)) (defmethod set-collide-kinds ((obj collide-shape) (arg0 int) (arg1 collide-kind) (arg2 collide-kind)) (let ((s3-0 (-> obj root-prim))) (if (logtest? (-> s3-0 prim-id) arg0) - (set! (-> s3-0 prim-core collide-as) (logior (logclear (-> s3-0 prim-core collide-as) arg1) arg2)) - ) - (let ((v1-7 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) collide-shape-prim-group)) - s3-0 - ) - ) - ) + (set! (-> s3-0 prim-core collide-as) (logior (logclear (-> s3-0 prim-core collide-as) arg1) arg2))) + (let ((v1-7 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) collide-shape-prim-group)) s3-0))) (when v1-7 (dotimes (a0-4 (-> (the-as collide-shape-prim-group v1-7) num-prims)) (let ((a1-4 (-> (the-as collide-shape-prim-group v1-7) prims a0-4))) (if (logtest? (-> a1-4 prim-id) arg0) - (set! (-> a1-4 prim-core collide-as) (logior (logclear (-> a1-4 prim-core collide-as) arg1) arg2)) - ) - ) - ) - ) - ) - ) + (set! (-> a1-4 prim-core collide-as) (logior (logclear (-> a1-4 prim-core collide-as) arg1) arg2)))))))) 0 - (none) - ) + (none)) (defmethod set-collide-offense ((obj collide-shape) (arg0 int) (arg1 collide-offense)) (let ((s4-0 (-> obj root-prim))) - (if (logtest? (-> s4-0 prim-id) arg0) - (set! (-> s4-0 prim-core offense) arg1) - ) - (let ((v1-5 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) collide-shape-prim-group)) - s4-0 - ) - ) - ) + (if (logtest? (-> s4-0 prim-id) arg0) (set! (-> s4-0 prim-core offense) arg1)) + (let ((v1-5 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) collide-shape-prim-group)) s4-0))) (when v1-5 (dotimes (a0-3 (-> (the-as collide-shape-prim-group v1-5) num-prims)) (let ((a1-4 (-> (the-as collide-shape-prim-group v1-5) prims a0-3))) - (if (logtest? (-> a1-4 prim-id) arg0) - (set! (-> a1-4 prim-core offense) arg1) - ) - ) - ) - ) - ) - ) + (if (logtest? (-> a1-4 prim-id) arg0) (set! (-> a1-4 prim-core offense) arg1))))))) 0 - (none) - ) + (none)) (defmethod send-shove-back ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process)) @@ -3444,27 +2434,19 @@ (when arg1 (let ((s1-0 (-> arg1 head))) (set! sv-144 arg0) - (let ((s5-0 (if (and (nonzero? sv-144) (type-type? (-> sv-144 type) process-drawable)) - sv-144 - ) - ) - ) + (let ((s5-0 (if (and (nonzero? sv-144) (type-type? (-> sv-144 type) process-drawable)) sv-144))) (when (and s1-0 s5-0) (let ((s0-1 (get-touched-prim s1-0 obj arg1))) (get-touched-prim s1-0 (-> (the-as process-drawable s5-0) root) arg1) (let* ((v1-8 (get-middle-of-bsphere-overlap s1-0 (new 'stack-no-clear 'vector))) - (s1-2 (vector-! (new 'stack-no-clear 'vector) v1-8 (the-as vector (-> s0-1 prim-core)))) - ) + (s1-2 (vector-! (new 'stack-no-clear 'vector) v1-8 (the-as vector (-> s0-1 prim-core))))) (vector-normalize! s1-2 1.0) (when (< arg2 (-> s1-2 y)) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> (the-as process-drawable s5-0) root transv quad)) (let ((f30-0 (vector-xz-length (-> (the-as process-drawable s5-0) root transv)))) - (if (= f30-0 0.0) - (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-drawable s5-0) root quat)) quad)) - ) - (vector-xz-normalize! s2-1 (fmax f30-0 arg4)) - ) + (if (= f30-0 0.0) (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-drawable s5-0) root quat)) quad))) + (vector-xz-normalize! s2-1 (fmax f30-0 arg4))) (set! (-> s2-1 y) arg3) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) pp) @@ -3474,21 +2456,9 @@ (let ((v1-18 (new 'static 'attack-info :mask #x802))) (set! (-> v1-18 vector quad) (-> s2-1 quad)) (set! (-> v1-18 angle) 'jump) - (set! (-> a1-8 param 1) (the-as uint v1-18)) - ) - (send-event-function s5-0 a1-8) - ) - ) - ) - ) - ) - ) - ) - ) - ) - (none) - ) - ) + (set! (-> a1-8 param 1) (the-as uint v1-18))) + (send-event-function s5-0 a1-8)))))))))) + (none))) (defmethod calc-shove-up ((obj collide-shape) (arg0 attack-info) (arg1 float)) (set! (-> arg0 shove-up) arg1) @@ -3496,19 +2466,12 @@ (s2-0 (-> s3-0 curve num-cverts)) (s4-0 (target-pos 0)) (s1-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector)) - ) + (s5-0 (new 'stack-no-clear 'vector))) (let ((f30-0 -1.0)) (dotimes (s0-0 s2-0) (eval-path-curve-div! s3-0 s1-0 (the float s0-0) 'interp) (let ((f0-3 (vector-vector-distance-squared s4-0 s1-0))) (when (or (< f30-0 0.0) (< f0-3 f30-0)) (set! f30-0 f0-3) - (set! (-> s5-0 quad) (-> s1-0 quad)) - ) - ) - ) - ) - (vector-! (-> arg0 vector) s5-0 s4-0) - ) - ) + (set! (-> s5-0 quad) (-> s1-0 quad)))))) + (vector-! (-> arg0 vector) s5-0 s4-0))) diff --git a/goal_src/jak1/engine/collide/collide-target-h.gc b/goal_src/jak1/engine/collide/collide-target-h.gc index 74ea1da5a0..eb5857c692 100644 --- a/goal_src/jak1/engine/collide/collide-target-h.gc +++ b/goal_src/jak1/engine/collide/collide-target-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/collide-shape-h.gc") ;; name: collide-target-h.gc @@ -13,187 +12,182 @@ ;; We believe that target's control-info may contain an array of these. ;; Each collide-history is a record of a single collision event. (deftype collide-history (structure) - ((intersect vector :inline) - (trans vector :inline) - (transv vector :inline) - (transv-out vector :inline) - (local-normal vector :inline) - (surface-normal vector :inline) - (time time-frame) - (status cshape-moving-flags) - (pat pat-surface) - (reaction-flag cshape-reaction-flags) - ) + ((intersect vector :inline) + (trans vector :inline) + (transv vector :inline) + (transv-out vector :inline) + (local-normal vector :inline) + (surface-normal vector :inline) + (time time-frame) + (status cshape-moving-flags) + (pat pat-surface) + (reaction-flag cshape-reaction-flags)) (:methods - (update! (_type_ collide-shape-moving vector vector vector) _type_) - ) - ) + (update! (_type_ collide-shape-moving vector vector vector) _type_))) ;; This is the collide shape for target (Jak). ;; It is complicated. (deftype control-info (collide-shape-moving) - ((unknown-vector00 vector :inline :offset 448) - (unknown-vector01 vector :inline :offset 464) - (unknown-vector02 vector :inline :offset 480) - (unknown-quaternion00 quaternion :inline :offset 496) - (unknown-quaternion01 quaternion :inline :offset 512) - (unknown-float00 float :offset 528) - (unknown-float01 float :offset 532) - (unknown-float02 float :offset 536) - (unknown-vector10 vector :inline :offset 544) - (unknown-vector11 vector :inline :offset 560) - (unknown-vector12 vector :inline :offset 576) - (unknown-vector13 vector :inline :offset 592) - (unknown-vector14 vector :inline :offset 608) - (unknown-vector15 vector :inline :offset 624) - (unknown-vector16 vector :inline :offset 640) - (unknown-dynamics00 dynamics :offset 656) - (unknown-surface00 surface :offset 660) - (unknown-surface01 surface :offset 664) - (unknown-cpad-info00 cpad-info :offset 668) - (unknown-float10 float :offset 672) - (unknown-float11 float :offset 676) - (unknown-float12 float :offset 680) - (unknown-float13 float :offset 684) - (unknown-vector20 vector :inline :offset 688) - (unknown-vector21 vector :inline :offset 704) - (unknown-vector22 vector :inline :offset 720) - (unknown-vector23 vector :inline :offset 736) - (unknown-vector-array00 vector 7 :inline :offset 752) - (unknown-vector30 vector :inline :offset 880) - (unknown-vector31 vector :inline :offset 896) - (unknown-float20 float :offset 912) - (unknown-float21 float :offset 916) - (unknown-dword00 uint64 :offset 920) - (unknown-matrix00 matrix :inline :offset 928) - (unknown-matrix01 matrix :inline :offset 992) - (unknown-matrix02 matrix :inline :offset 1056) - (unknown-qword00 uint128 :offset 1136) - (unknown-float30 float :offset 1140) - (unknown-vector40 vector :inline :offset 1152) - (unknown-float40 float :offset 1172) - (unknown-float41 float :offset 1176) - (unknown-int00 int32 :offset 1180) - (unknown-float50 float :offset 1168) - (unknown-vector50 vector :inline :offset 1184) - (unknown-vector51 vector :inline :offset 1200) - (unknown-vector52 vector :inline :offset 1216) - (unknown-vector53 vector :inline :offset 1232) - (last-known-safe-ground vector :inline :offset 1248) - (unknown-vector55 vector :inline :offset 1264) - (unknown-dword10 time-frame :offset 1280) - (unknown-dword11 time-frame :offset 1288) - (unknown-float60 float :offset 1300) - (unknown-float61 float :offset 1304) - (unknown-float62 float :offset 1308) - (unknown-float63 float :offset 1312) - (unknown-float64 float :offset 1316) - (unknown-dword20 time-frame :offset 1320) - (unknown-dword21 time-frame :offset 1328) - (unknown-dword-coverage int64 :offset 1336) - (unknown-float-coverage-0 float :offset 1344) - (unknown-float-coverage-1 float :offset 1348) - (unknown-float-coverage-2 float :offset 1352) - (unknown-u32-coverage-0 uint32 :offset 1356) - (unknown-vector-coverage-0 vector :inline :offset 1376) - (unknown-vector-coverage-1 vector :inline :offset 1392) - (unknown-vector-coverage-2 vector :inline :offset 1440) - (unknown-vector-coverage-3 vector :inline :offset 1472) - (unknown-vector60 vector :inline :offset 1456) - (unknown-vector61 vector :inline :offset 1504) - (unknown-float70 float :offset 1520) - (unknown-float71 float :offset 1524) - (unknown-vector70 vector :inline :offset 1536) - (unknown-vector71 vector :inline :offset 1552) - (unknown-vector72 vector :inline :offset 1568) - (unknown-vector73 vector :inline :offset 1584) - (unknown-handle00 handle :offset 1600) - (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) - (unknown-sphere00 collide-shape-prim-sphere :offset 1632) - (unknown-sphere01 collide-shape-prim-sphere :offset 1636) - (unknown-sphere02 collide-shape-prim-sphere :offset 1640) - (unknown-int50 int32 :offset 1656) - (unknown-dword30 time-frame :offset 1664) - (unknown-dword31 time-frame :offset 1672) - (unknown-dword32 time-frame :offset 1680) - (unknown-dword33 time-frame :offset 1688) - (unknown-dword34 time-frame :offset 1696) - (unknown-dword35 time-frame :offset 1704) - (unknown-dword36 time-frame :offset 1712) - (unknown-float80 float :offset 1724) - (unknown-float81 float :offset 1728) - (unknown-float82 float :offset 1732) - (unknown-vector80 vector :inline :offset 1744) - (unknown-cspace00 cspace :inline :offset 1760) - (unknown-vector90 vector :inline :offset 1776) - (unknown-vector91 vector :inline :offset 1792) - (unknown-vector92 vector :inline :offset 1824) - (unknown-cspace10 cspace :inline :offset 1808) - (unknown-symbol00 symbol :offset 1840) - (unknown-float90 float :offset 1844) - (unknown-float91 float :offset 1848) - (unknown-vector-array10 vector 16 :inline :offset 1856) - (unknown-float100 float :offset 2112) - (unknown-int10 int32 :offset 2116) - (unknown-float110 float :offset 2120) - (unknown-vector100 vector :inline :offset 2128) - (unknown-vector101 vector :inline :offset 2144) - (unknown-dword40 time-frame :offset 2160) - (unknown-dword41 time-frame :offset 2168) - (unknown-handle10 handle :offset 2176) - (unknown-uint20 uint32 :offset 2184) - (unknown-spoolanim00 spool-anim :overlay-at unknown-uint20) - (unknown-int20 int32 :overlay-at unknown-spoolanim00) - (unknown-symbol20 symbol :overlay-at unknown-int20) - (unknown-float120 float :overlay-at unknown-symbol20) - (unknown-int21 int32 :offset 2188) - (unknown-uint30 uint32 :overlay-at unknown-int21) - (unknown-float121 float :overlay-at unknown-uint30) - (unknown-uint31 uint32 :offset 2192) - (unknown-int37 int32 :overlay-at unknown-uint31) - (unknown-float122 float :offset 2196) - (unknown-float123 float :offset 2200) - (unknown-float124 float :offset 2204) - (unknown-vector102 vector :inline :offset 2224) - (unknown-vector103 vector :inline :offset 2240) - (unknown-quaternion02 quaternion :inline :offset 2256) - (unknown-quaternion03 quaternion :inline :offset 2272) - (unknown-smush00 smush-control :inline :offset 2288) - (unknown-vector110 vector :inline :offset 2320) - (unknown-vector111 vector :inline :offset 2336) - (unknown-symbol30 symbol :offset 2384) - (unknown-int31 uint32 :overlay-at unknown-symbol30) - (unknown-dword50 int64 :offset 2392) - (unknown-dword51 int64 :offset 2400) - (unknown-pointer00 pointer :offset 2416) - (unknown-symbol40 symbol :offset 2428) - (unknown-dword60 int64 :offset 2432) - (unknown-dword61 int64 :offset 2440) - (unknown-dword62 int64 :offset 2448) - (unknown-dword63 int64 :offset 2456) - (unknown-halfword00 int16 :offset 2488) - (history-length int16 :offset 2490) - (history-data collide-history 128 :inline) - (unknown-float140 float :offset 18944) - (unknown-dword70 time-frame :offset 18952) - (unknown-int40 int32 :offset 18880) - (unknown-dword80 time-frame :offset 18888) - (unknown-dword81 time-frame :offset 18896) - (unknown-float130 float :offset 18904) - (unknown-float131 float :offset 18908) - (unknown-dword82 time-frame :offset 18912) - (unknown-vector120 vector :inline :offset 18928) - (unknown-float150 float :overlay-at unknown-float140) - (unknown-vector121 vector :inline :offset 18960) - (wall-pat pat-surface :offset 18976) - (unknown-soundid00 sound-id :offset 18980) - (unknown-float141 float :offset 18984) - (unknown-soundid01 sound-id :offset 18988) - (unknown-int34 int32 :offset 18992) - (unknown-int35 int32 :offset 18996) - (unknown-int36 int32 :offset 19000) - ) - ) + ((unknown-vector00 vector :inline :offset 448) + (unknown-vector01 vector :inline :offset 464) + (unknown-vector02 vector :inline :offset 480) + (unknown-quaternion00 quaternion :inline :offset 496) + (unknown-quaternion01 quaternion :inline :offset 512) + (unknown-float00 float :offset 528) + (unknown-float01 float :offset 532) + (unknown-float02 float :offset 536) + (unknown-vector10 vector :inline :offset 544) + (unknown-vector11 vector :inline :offset 560) + (unknown-vector12 vector :inline :offset 576) + (unknown-vector13 vector :inline :offset 592) + (unknown-vector14 vector :inline :offset 608) + (unknown-vector15 vector :inline :offset 624) + (unknown-vector16 vector :inline :offset 640) + (unknown-dynamics00 dynamics :offset 656) + (unknown-surface00 surface :offset 660) + (unknown-surface01 surface :offset 664) + (unknown-cpad-info00 cpad-info :offset 668) + (unknown-float10 float :offset 672) + (unknown-float11 float :offset 676) + (unknown-float12 float :offset 680) + (unknown-float13 float :offset 684) + (unknown-vector20 vector :inline :offset 688) + (unknown-vector21 vector :inline :offset 704) + (unknown-vector22 vector :inline :offset 720) + (unknown-vector23 vector :inline :offset 736) + (unknown-vector-array00 vector 7 :inline :offset 752) + (unknown-vector30 vector :inline :offset 880) + (unknown-vector31 vector :inline :offset 896) + (unknown-float20 float :offset 912) + (unknown-float21 float :offset 916) + (unknown-dword00 uint64 :offset 920) + (unknown-matrix00 matrix :inline :offset 928) + (unknown-matrix01 matrix :inline :offset 992) + (unknown-matrix02 matrix :inline :offset 1056) + (unknown-qword00 uint128 :offset 1136) + (unknown-float30 float :offset 1140) + (unknown-vector40 vector :inline :offset 1152) + (unknown-float40 float :offset 1172) + (unknown-float41 float :offset 1176) + (unknown-int00 int32 :offset 1180) + (unknown-float50 float :offset 1168) + (unknown-vector50 vector :inline :offset 1184) + (unknown-vector51 vector :inline :offset 1200) + (unknown-vector52 vector :inline :offset 1216) + (unknown-vector53 vector :inline :offset 1232) + (last-known-safe-ground vector :inline :offset 1248) + (unknown-vector55 vector :inline :offset 1264) + (unknown-dword10 time-frame :offset 1280) + (unknown-dword11 time-frame :offset 1288) + (unknown-float60 float :offset 1300) + (unknown-float61 float :offset 1304) + (unknown-float62 float :offset 1308) + (unknown-float63 float :offset 1312) + (unknown-float64 float :offset 1316) + (unknown-dword20 time-frame :offset 1320) + (unknown-dword21 time-frame :offset 1328) + (unknown-dword-coverage int64 :offset 1336) + (unknown-float-coverage-0 float :offset 1344) + (unknown-float-coverage-1 float :offset 1348) + (unknown-float-coverage-2 float :offset 1352) + (unknown-u32-coverage-0 uint32 :offset 1356) + (unknown-vector-coverage-0 vector :inline :offset 1376) + (unknown-vector-coverage-1 vector :inline :offset 1392) + (unknown-vector-coverage-2 vector :inline :offset 1440) + (unknown-vector-coverage-3 vector :inline :offset 1472) + (unknown-vector60 vector :inline :offset 1456) + (unknown-vector61 vector :inline :offset 1504) + (unknown-float70 float :offset 1520) + (unknown-float71 float :offset 1524) + (unknown-vector70 vector :inline :offset 1536) + (unknown-vector71 vector :inline :offset 1552) + (unknown-vector72 vector :inline :offset 1568) + (unknown-vector73 vector :inline :offset 1584) + (unknown-handle00 handle :offset 1600) + (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) + (unknown-sphere00 collide-shape-prim-sphere :offset 1632) + (unknown-sphere01 collide-shape-prim-sphere :offset 1636) + (unknown-sphere02 collide-shape-prim-sphere :offset 1640) + (unknown-int50 int32 :offset 1656) + (unknown-dword30 time-frame :offset 1664) + (unknown-dword31 time-frame :offset 1672) + (unknown-dword32 time-frame :offset 1680) + (unknown-dword33 time-frame :offset 1688) + (unknown-dword34 time-frame :offset 1696) + (unknown-dword35 time-frame :offset 1704) + (unknown-dword36 time-frame :offset 1712) + (unknown-float80 float :offset 1724) + (unknown-float81 float :offset 1728) + (unknown-float82 float :offset 1732) + (unknown-vector80 vector :inline :offset 1744) + (unknown-cspace00 cspace :inline :offset 1760) + (unknown-vector90 vector :inline :offset 1776) + (unknown-vector91 vector :inline :offset 1792) + (unknown-vector92 vector :inline :offset 1824) + (unknown-cspace10 cspace :inline :offset 1808) + (unknown-symbol00 symbol :offset 1840) + (unknown-float90 float :offset 1844) + (unknown-float91 float :offset 1848) + (unknown-vector-array10 vector 16 :inline :offset 1856) + (unknown-float100 float :offset 2112) + (unknown-int10 int32 :offset 2116) + (unknown-float110 float :offset 2120) + (unknown-vector100 vector :inline :offset 2128) + (unknown-vector101 vector :inline :offset 2144) + (unknown-dword40 time-frame :offset 2160) + (unknown-dword41 time-frame :offset 2168) + (unknown-handle10 handle :offset 2176) + (unknown-uint20 uint32 :offset 2184) + (unknown-spoolanim00 spool-anim :overlay-at unknown-uint20) + (unknown-int20 int32 :overlay-at unknown-spoolanim00) + (unknown-symbol20 symbol :overlay-at unknown-int20) + (unknown-float120 float :overlay-at unknown-symbol20) + (unknown-int21 int32 :offset 2188) + (unknown-uint30 uint32 :overlay-at unknown-int21) + (unknown-float121 float :overlay-at unknown-uint30) + (unknown-uint31 uint32 :offset 2192) + (unknown-int37 int32 :overlay-at unknown-uint31) + (unknown-float122 float :offset 2196) + (unknown-float123 float :offset 2200) + (unknown-float124 float :offset 2204) + (unknown-vector102 vector :inline :offset 2224) + (unknown-vector103 vector :inline :offset 2240) + (unknown-quaternion02 quaternion :inline :offset 2256) + (unknown-quaternion03 quaternion :inline :offset 2272) + (unknown-smush00 smush-control :inline :offset 2288) + (unknown-vector110 vector :inline :offset 2320) + (unknown-vector111 vector :inline :offset 2336) + (unknown-symbol30 symbol :offset 2384) + (unknown-int31 uint32 :overlay-at unknown-symbol30) + (unknown-dword50 int64 :offset 2392) + (unknown-dword51 int64 :offset 2400) + (unknown-pointer00 pointer :offset 2416) + (unknown-symbol40 symbol :offset 2428) + (unknown-dword60 int64 :offset 2432) + (unknown-dword61 int64 :offset 2440) + (unknown-dword62 int64 :offset 2448) + (unknown-dword63 int64 :offset 2456) + (unknown-halfword00 int16 :offset 2488) + (history-length int16 :offset 2490) + (history-data collide-history 128 :inline) + (unknown-float140 float :offset 18944) + (unknown-dword70 time-frame :offset 18952) + (unknown-int40 int32 :offset 18880) + (unknown-dword80 time-frame :offset 18888) + (unknown-dword81 time-frame :offset 18896) + (unknown-float130 float :offset 18904) + (unknown-float131 float :offset 18908) + (unknown-dword82 time-frame :offset 18912) + (unknown-vector120 vector :inline :offset 18928) + (unknown-float150 float :overlay-at unknown-float140) + (unknown-vector121 vector :inline :offset 18960) + (wall-pat pat-surface :offset 18976) + (unknown-soundid00 sound-id :offset 18980) + (unknown-float141 float :offset 18984) + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000))) (defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) "Update the collide-history element." @@ -207,5 +201,4 @@ (set! (-> this status) (-> cshape status)) (set! (-> this reaction-flag) (-> cshape reaction-flag)) (set! (-> this pat) (-> cshape cur-pat)) - this - ) + this) diff --git a/goal_src/jak1/engine/collide/collide-touch-h.gc b/goal_src/jak1/engine/collide/collide-touch-h.gc index a3a99eacce..bbf749c89c 100644 --- a/goal_src/jak1/engine/collide/collide-touch-h.gc +++ b/goal_src/jak1/engine/collide/collide-touch-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "kernel-defs.gc") ;; name: collide-touch-h.gc @@ -16,52 +15,40 @@ ;; As the collision is resolved, shapes are added and removed from the touching list. ;; Once collision is done solving, you can send events or inspect what you touched! - (defconstant TOUCHING_LIST_LENGTH 32) ;; DECOMP BEGINS ;; A record of a primitive which is touching another, possibly including the triangle that is involved. (deftype touching-prim (structure) - ((cprim collide-shape-prim) - (has-tri? symbol) - (tri collide-tri-result :inline) - ) - ) - + ((cprim collide-shape-prim) + (has-tri? symbol) + (tri collide-tri-result :inline))) ;; A record of two primitives which are touching. (deftype touching-prims-entry (structure) - ((next touching-prims-entry) - (prev touching-prims-entry) - (allocated? symbol) - (u float) - (prim1 touching-prim :inline) - (prim2 touching-prim :inline) - ) + ((next touching-prims-entry) + (prev touching-prims-entry) + (allocated? symbol) + (u float) + (prim1 touching-prim :inline) + (prim2 touching-prim :inline)) (:methods - (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) - (touching-prims-entry-method-10 () none) - (get-middle-of-bsphere-overlap (_type_ vector) vector) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) - ) - ) - + (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) + (touching-prims-entry-method-10 () none) + (get-middle-of-bsphere-overlap (_type_ vector) vector) + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result))) ;; A pool of up to 64 touching primitives. There is a linked list of freed entries. (deftype touching-prims-entry-pool (structure) - ((head touching-prims-entry) - (nodes touching-prims-entry 64 :inline) - ) + ((head touching-prims-entry) + (nodes touching-prims-entry 64 :inline)) (:methods - (new (symbol type) _type_) - (alloc-node (_type_) touching-prims-entry) - (get-free-node-count (_type_) int) - (init-list! (_type_) none) - (free-node (_type_ touching-prims-entry) touching-prims-entry) - ) - ) - + (new (symbol type) _type_) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) + (init-list! (_type_) none) + (free-node (_type_ touching-prims-entry) touching-prims-entry))) (defmethod init-list! ((this touching-prims-entry-pool)) "Initialize all entries to be not allocated and in a linked list." @@ -74,14 +61,9 @@ (set! (-> current next) (the-as touching-prims-entry next)) (set! (-> current allocated?) #f) (set! prev current) - (set! current (the-as touching-prims-entry next)) - ) - ) - ) - (set! (-> prev next) #f) - ) - (none) - ) + (set! current (the-as touching-prims-entry next))))) + (set! (-> prev next) #f)) + (none)) (defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) "Allocate and initialize a new touching-prims-entry-pool" @@ -89,80 +71,64 @@ ;; Note - the original code passed (-> type-to-make size) as an argument. ;; however, the new method of structure doesn't have this argument. ;; it uses the same value for the size so it doesn't really matter. - (let ((this (the touching-prims-entry-pool ((method-of-type structure new) - allocation - type-to-make - ;; (-> type-to-make size) see note - ) - ))) + (let ((this (the touching-prims-entry-pool + ((method-of-type structure new) allocation + type-to-make + ;; (-> type-to-make size) see note + )))) (init-list! this) - this - ) - ) - + this)) ;; two collide shapes which are touching. ;; This stores a list of primitive pairs which are touching. (deftype touching-shapes-entry (structure) - ((cshape1 collide-shape) - (cshape2 collide-shape) - (resolve-u int8) - (head touching-prims-entry) - ) + ((cshape1 collide-shape) + (cshape2 collide-shape) + (resolve-u int8) + (head touching-prims-entry)) :allow-misaligned (:methods - (touching-shapes-entry-method-9 (_type_) none) - (get-touched-shape (_type_ collide-shape) collide-shape) - (touching-shapes-entry-method-11 () none) - (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) - (touching-shapes-entry-method-14 () none) - (free-touching-prims-list (_type_) symbol) - (get-head (_type_) touching-prims-entry) - (get-next (_type_ touching-prims-entry) touching-prims-entry) - ) - ) + (touching-shapes-entry-method-9 (_type_) none) + (get-touched-shape (_type_ collide-shape) collide-shape) + (touching-shapes-entry-method-11 () none) + (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) + (touching-shapes-entry-method-14 () none) + (free-touching-prims-list (_type_) symbol) + (get-head (_type_) touching-prims-entry) + (get-next (_type_ touching-prims-entry) touching-prims-entry))) ;; A list of (up to) TOUCHING_LIST_LENGTH pairs of colliding shapes (deftype touching-list (structure) - ((num-touching-shapes int32) - (resolve-u int8) - (touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline) - ) + ((num-touching-shapes int32) + (resolve-u int8) + (touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline)) (:methods - (new (symbol type) _type_) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) - (touching-list-method-10 () none) - (update-from-step-size (_type_ float) none) - (send-events-for-touching-shapes (_type_) none) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) - (free-all-prim-nodes (_type_) none) - ) - ) - + (new (symbol type) _type_) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (touching-list-method-10 () none) + (update-from-step-size (_type_ float) none) + (send-events-for-touching-shapes (_type_) none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) + (free-all-prim-nodes (_type_) none))) (defmethod new touching-list ((allocation symbol) (type-to-make type)) "See note in touching-prims-entry-pool" ;; og:preserve-this - (let ((this (the touching-list ((method-of-type structure new) - allocation - type-to-make - ;; (-> type-to-make size) see note - ) - ))) + (let ((this (the touching-list + ((method-of-type structure new) allocation + type-to-make + ;; (-> type-to-make size) see note + )))) (set! (-> this num-touching-shapes) 0) (set! (-> this resolve-u) 0) - this - ) - ) + this)) (defmethod get-head ((this touching-shapes-entry)) - (-> this head) - ) + (-> this head)) (defmethod get-next ((this touching-shapes-entry) (arg0 touching-prims-entry)) - (-> arg0 next) - ) + (-> arg0 next)) ;; Allocate the global touching lists. ;; We have a pool of prim pairs that can be used in any shape pair diff --git a/goal_src/jak1/engine/collide/collide-touch.gc b/goal_src/jak1/engine/collide/collide-touch.gc index 21a27e6679..098bcb4da5 100644 --- a/goal_src/jak1/engine/collide/collide-touch.gc +++ b/goal_src/jak1/engine/collide/collide-touch.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/collide/collide-touch-h.gc") (require "kernel/gstate.gc") (require "engine/target/target-h.gc") @@ -34,41 +33,20 @@ (defmethod get-free-node-count ((this touching-prims-entry-pool)) "Get the number of nodes that are not in use." (let ((v0-0 0)) - (let ((v1-0 (-> this head))) - (while v1-0 - (+! v0-0 1) - (set! v1-0 (-> v1-0 next)) - (nop!) - (nop!) - (nop!) - ) - ) - v0-0 - ) - ) + (let ((v1-0 (-> this head))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> v1-0 next)) (nop!) (nop!) (nop!))) + v0-0)) (defmethod alloc-node ((this touching-prims-entry-pool)) "Allocate a node. Will return #f if there are none left." (let ((gp-0 (-> this head))) (cond (gp-0 - (let ((v1-0 (-> gp-0 next))) - (set! (-> this head) v1-0) - (if v1-0 - (set! (-> v1-0 prev) #f) - ) - ) - (set! (-> gp-0 allocated?) #t) - (set! (-> gp-0 next) #f) - (set! (-> gp-0 prev) #f) - ) - (else - (format 0 "ERROR: touching-prims-entry-pool::alloc-node() failed!~%") - ) - ) - gp-0 - ) - ) + (let ((v1-0 (-> gp-0 next))) (set! (-> this head) v1-0) (if v1-0 (set! (-> v1-0 prev) #f))) + (set! (-> gp-0 allocated?) #t) + (set! (-> gp-0 next) #f) + (set! (-> gp-0 prev) #f)) + (else (format 0 "ERROR: touching-prims-entry-pool::alloc-node() failed!~%"))) + gp-0)) (defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) "Free a node allocated with alloc-node" @@ -78,12 +56,7 @@ (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) (set! (-> this head) arg0) - (if v1-1 - (set! (-> v1-1 prev) arg0) - ) - ) - ) - ) + (if v1-1 (set! (-> v1-1 prev) arg0))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Shapes Entry @@ -101,17 +74,8 @@ (set! (-> this head) #f) (let ((s5-0 *touching-prims-entry-pool*)) (while gp-0 - (let ((a1-0 gp-0)) - (set! gp-0 (-> a1-0 next)) - (free-node s5-0 a1-0) - ) - ) - ) - #f - ) - ) - ) - ) + (let ((a1-0 gp-0)) (set! gp-0 (-> a1-0 next)) (free-node s5-0 a1-0)))) + #f)))) ;;;;;;;;;;;;;;;;;;;;;; ;; Touching List @@ -124,78 +88,53 @@ (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) - (&+! s5-0 16) - ) - ) + (&+! s5-0 16))) (set! (-> this num-touching-shapes) 0) (set! (-> this resolve-u) 0) 0 - (none) - ) - + (none)) (defmethod get-shapes-entry ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) "Get a touching-shapes-entry for the two shapes. If one exists, it will be returned. Otherwise a new one will be made." (let ((v0-0 (the-as touching-shapes-entry (-> this touching-shapes)))) ;; the candidate - (let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one - + (let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one ;; loop over all touching shapes (countdown (a3-0 (-> this num-touching-shapes)) (let ((t0-0 (-> v0-0 cshape1))) (set! v1-0 (cond (t0-0 - ;; in use. If it's match, return it (allows a,b or b,a to match a,b) - (if (or (and (= t0-0 arg0) (= (-> v0-0 cshape2) arg1)) (and (= t0-0 arg1) (= (-> v0-0 cshape2) arg0))) - (return v0-0) - ) - ;; otherwise bad - v1-0 - ) + ;; in use. If it's match, return it (allows a,b or b,a to match a,b) + (if (or (and (= t0-0 arg0) (= (-> v0-0 cshape2) arg1)) (and (= t0-0 arg1) (= (-> v0-0 cshape2) arg0))) (return v0-0)) + ;; otherwise bad + v1-0) (else - ;; not in use. remember it's free and keep looking. - v0-0 - ) - ) - ) - ) - (&+! v0-0 16) - ) - + ;; not in use. remember it's free and keep looking. + v0-0)))) + (&+! v0-0 16)) ;; done looping. (cond (v1-0 ;; did we find an unused slot? if so return it - (set! v0-0 v1-0) - ) + (set! v0-0 v1-0)) (else - ;; need to add a new one - (when (>= (-> this num-touching-shapes) TOUCHING_LIST_LENGTH) - ;; but there's no room! - (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") - (return (the-as touching-shapes-entry #f)) - ) - ;; enough room, increase the size - (+! (-> this num-touching-shapes) 1) - ) - ) - ) - + ;; need to add a new one + (when (>= (-> this num-touching-shapes) TOUCHING_LIST_LENGTH) + ;; but there's no room! + (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") + (return (the-as touching-shapes-entry #f))) + ;; enough room, increase the size + (+! (-> this num-touching-shapes) 1)))) ;; if we're doing a new one, set it up. (set! (-> v0-0 cshape1) arg0) (set! (-> v0-0 cshape2) arg1) (set! (-> v0-0 head) #f) (set! (-> v0-0 resolve-u) 1) (set! (-> this resolve-u) 1) - (the-as touching-shapes-entry v0-0) - ) - ) + (the-as touching-shapes-entry v0-0))) (deftype add-prims-touching-work (structure) - ((tri1 collide-tri-result) - (tri2 collide-tri-result) - ) - ) - + ((tri1 collide-tri-result) + (tri2 collide-tri-result))) ;;;;;;;;;;;;;;;;;;;;;;;;; ;; Touching List Update @@ -212,37 +151,22 @@ ;; "What happens if I move forward 0.7 timesteps?" ;; .. repeat .. - - - -(defmethod add-touching-prims ((this touching-list) - (arg0 collide-shape-prim) - (arg1 collide-shape-prim) - (arg2 float) - (arg3 collide-tri-result) - (arg4 collide-tri-result) - ) +(defmethod add-touching-prims ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) (arg3 collide-tri-result) (arg4 collide-tri-result)) "Tell the touching list that if we end taking a step of at least arg2, the prims arg0/arg1 will collide. However, you don't have to know for sure if you're going to take this big of a step yet. You can provide triangles if you want, but you don't have to. The logic for calling this twice for the same prims in between calls to update-from-step-size is a little weird so I suspect this never happens (and it's probably cheaper to avoid this duplication in the actual prim collision code)." - ;; I don't know why they made this type, but I'm guessing it's to avoid the compiler spilling to the stack (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) - ;; first, grab the entry for the collide-shapes involved. (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) (when s2-0 ;; if we ask for a,b, that function might give us b,a. Detect that, and swap our collide shape prims. (when (= (-> s2-0 cshape1) (-> arg1 cshape)) - (let ((v1-4 arg0)) - (set! arg0 arg1) - (set! arg1 v1-4) - ) - ) + (let ((v1-4 arg0)) (set! arg0 arg1) (set! arg1 v1-4))) (let ((s0-0 (-> s2-0 head))) ;; loop over all the entries in the shapes (while s0-0 @@ -253,42 +177,24 @@ ;; this value is unused. (-> s0-0 u) (let ((v1-12 (-> s0-0 prim1)) - (a1-2 (-> gp-0 tri1)) - ) + (a1-2 (-> gp-0 tri1))) (cond (a1-2 - ;; we have a tri, copy it - (set! (-> v1-12 has-tri?) #t) - (mem-copy! (the-as pointer (-> v1-12 tri)) (the-as pointer a1-2) 84) - ) + ;; we have a tri, copy it + (set! (-> v1-12 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-12 tri)) (the-as pointer a1-2) 84)) (else - ;; no tri - (set! (-> v1-12 has-tri?) #f) - ) - ) - ) + ;; no tri + (set! (-> v1-12 has-tri?) #f)))) ;; same for the other tri. (let ((v1-15 (-> s0-0 prim2)) - (a1-3 (-> gp-0 tri2)) - ) + (a1-3 (-> gp-0 tri2))) (cond - (a1-3 - (set! (-> v1-15 has-tri?) #t) - (mem-copy! (the-as pointer (-> v1-15 tri)) (the-as pointer a1-3) 84) - ) - (else - (set! (-> v1-15 has-tri?) #f) - ) - ) - ) - ) + (a1-3 (set! (-> v1-15 has-tri?) #t) (mem-copy! (the-as pointer (-> v1-15 tri)) (the-as pointer a1-3) 84)) + (else (set! (-> v1-15 has-tri?) #f))))) ;; after we found the matching node for these prims, we're done! - (return 0) - ) - (set! s0-0 (-> s0-0 next)) - ) - ) - + (return 0)) + (set! s0-0 (-> s0-0 next)))) ;; nope, didn't find an entry, so make a new one. (let ((s0-1 (alloc-node *touching-prims-entry-pool*))) ;; allocate a new node, link it. @@ -297,58 +203,31 @@ (set! (-> s0-1 next) v1-22) (set! (-> s0-1 prev) #f) (set! (-> s2-0 head) s0-1) - (if v1-22 - (set! (-> v1-22 prev) s0-1) - ) - ) + (if v1-22 (set! (-> v1-22 prev) s0-1))) ;; and set it up. (set! (-> s0-1 u) arg2) (when (>= arg2 0.0) ;; if we're >0, we have to move (which we haven't done yet) to actually collide. ;; flag us as resolve-u (meaning our u is from the resolve function, which looks at what _would_ ;; happen if we did it all at once.) - ;; if we're <0, we started in collision (possible, if we didnt' converge on the last frame) ;; we should still add, but we don't need to bother with the "did we go far enough" checks. (set! (-> s2-0 resolve-u) 1) - (set! (-> this resolve-u) 1) - ) + (set! (-> this resolve-u) 1)) (let ((v1-26 (-> s0-1 prim1)) - (a1-4 (-> gp-0 tri1)) - ) + (a1-4 (-> gp-0 tri1))) (set! (-> v1-26 cprim) arg0) (cond - (a1-4 - (set! (-> v1-26 has-tri?) #t) - (mem-copy! (the-as pointer (-> v1-26 tri)) (the-as pointer a1-4) 84) - ) - (else - (set! (-> v1-26 has-tri?) #f) - ) - ) - ) + (a1-4 (set! (-> v1-26 has-tri?) #t) (mem-copy! (the-as pointer (-> v1-26 tri)) (the-as pointer a1-4) 84)) + (else (set! (-> v1-26 has-tri?) #f)))) (let ((v1-29 (-> s0-1 prim2)) - (a1-5 (-> gp-0 tri2)) - ) + (a1-5 (-> gp-0 tri2))) (set! (-> v1-29 cprim) arg1) (cond - (a1-5 - (set! (-> v1-29 has-tri?) #t) - (mem-copy! (the-as pointer (-> v1-29 tri)) (the-as pointer a1-5) 84) - ) - (else - (set! (-> v1-29 has-tri?) #f) - ) - ) - ) - ) - ) - ) - ) - ) + (a1-5 (set! (-> v1-29 has-tri?) #t) (mem-copy! (the-as pointer (-> v1-29 tri)) (the-as pointer a1-5) 84)) + (else (set! (-> v1-29 has-tri?) #f))))))))) 0 - (none) - ) + (none)) (defmethod update-from-step-size ((this touching-list) (arg0 float)) "Given that we actually will take a step size of arg0, remove things we won't actually hit." @@ -356,7 +235,6 @@ (when (nonzero? (-> this resolve-u)) ;; remember we did it (set! (-> this resolve-u) 0) - ;; loop through touching-shape-entries (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) @@ -381,52 +259,26 @@ ;; we set the u to -1.0 to indicate that we're massively intersecting. ;; this will no longer be eligible for removal because we actually hit it. (set! (-> s3-0 u) -1.0) - (set! s3-0 (-> s3-0 next)) - ) + (set! s3-0 (-> s3-0 next))) (else - ;; we would have needed to move more than arg0 to hit this one. - ;; at least for now, remove by splicing out of the list and freeing. - (let ((a1-1 s3-0)) ;; this - (let ((v1-7 (-> s3-0 next))) ;; next - (let ((a0-1 (-> s3-0 prev))) ;; prev - (if a0-1 - (set! (-> a0-1 next) v1-7) - (set! (-> s5-0 head) v1-7) - ) - (if v1-7 - (set! (-> v1-7 prev) a0-1) - ) - ) - (set! s3-0 v1-7) - ) - (free-node *touching-prims-entry-pool* a1-1) - ) - ) - ) - s3-0 - ) + ;; we would have needed to move more than arg0 to hit this one. + ;; at least for now, remove by splicing out of the list and freeing. + (let ((a1-1 s3-0)) ;; this + (let ((v1-7 (-> s3-0 next))) ;; next + (let ((a0-1 (-> s3-0 prev))) ;; prev + (if a0-1 (set! (-> a0-1 next) v1-7) (set! (-> s5-0 head) v1-7)) + (if v1-7 (set! (-> v1-7 prev) a0-1))) + (set! s3-0 v1-7)) + (free-node *touching-prims-entry-pool* a1-1)))) + s3-0) (else - ;; not touching, advance to the next. - (-> s3-0 next) - ) - ) - ) - ) - ) - ) + ;; not touching, advance to the next. + (-> s3-0 next))))))) ;; if we removed everything from this, mark it as dead (the allocation function will reuse it now) - (if (not (-> s5-0 head)) - (set! (-> s5-0 cshape1) #f) - ) - ) - ) - (&+! s5-0 16) - ) - ) - ) + (if (not (-> s5-0 head)) (set! (-> s5-0 cshape1) #f)))) + (&+! s5-0 16)))) 0 - (none) - ) + (none)) (defmethod send-events-for-touching-shapes ((this touching-list)) "Send all events for touching shapes. @@ -439,80 +291,39 @@ ;; the touching list will run its logic on it regardless. ;; this is fixed here by creating a really large list of 2 handles per collide shape and storing all collided ;; process handles there. (process->handle) is then safe to use. - ; (* 2 TOUCHING_LIST_LENGTH) -> 64 (let ((handles (new 'stack-no-clear 'array 'handle 64))) - - (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) - (countdown (i (-> this num-touching-shapes)) - (let ((c1 (-> entry cshape1))) - (when c1 - (let ((c2 (-> entry cshape2))) - - ;; not quite sure why, but we make it look like cshape1 (s4) is target always. - ;; I guess this makes it so the target/enemy events are always sent in the same order. - (when (= (-> c2 process type) target) - (swap! c1 c2) - ) - - (set! (-> handles (+ 0 (* 2 i))) (process->handle (-> c1 process))) - (set! (-> handles (+ 1 (* 2 i))) (process->handle (-> c2 process))) - ) - ) - ) - (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)) - ) - ) - - (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) - (countdown (i (-> this num-touching-shapes)) - (let ((c1 (-> entry cshape1))) - (when c1 - (let ((c2 (-> entry cshape2))) - - ;; not quite sure why, but we make it look like cshape1 (s4) is target always. - ;; I guess this makes it so the target/enemy events are always sent in the same order. - (when (= (-> c2 process type) target) - (swap! c1 c2) - ) - - ;; send events! - (let ( - (c1-proc (handle->process (-> handles (+ 0 (* 2 i))))) - (c2-proc (handle->process (-> handles (+ 1 (* 2 i))))) - ) - (let ((v1-4 (-> c1 event-self))) - (if v1-4 - (send-event c1-proc v1-4 :from c2-proc entry) - ) - ) - (let ((v1-5 (-> c1 event-other))) - (if v1-5 - (send-event c2-proc v1-5 :from c1-proc entry) - ) - ) - (let ((v1-6 (-> c2 event-self))) - (if v1-6 - (send-event c2-proc v1-6 :from c1-proc entry) - ) - ) - (let ((v1-7 (-> c2 event-other))) - (if v1-7 - (send-event c1-proc v1-7 :from c2-proc entry) - ) - ) - ) - ) - ) - ) - (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)) - ) - ) - - ) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (i (-> this num-touching-shapes)) + (let ((c1 (-> entry cshape1))) + (when c1 + (let ((c2 (-> entry cshape2))) + ;; not quite sure why, but we make it look like cshape1 (s4) is target always. + ;; I guess this makes it so the target/enemy events are always sent in the same order. + (when (= (-> c2 process type) target) + (swap! c1 c2)) + (set! (-> handles (+ 0 (* 2 i))) (process->handle (-> c1 process))) + (set! (-> handles (+ 1 (* 2 i))) (process->handle (-> c2 process)))))) + (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1)))) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (i (-> this num-touching-shapes)) + (let ((c1 (-> entry cshape1))) + (when c1 + (let ((c2 (-> entry cshape2))) + ;; not quite sure why, but we make it look like cshape1 (s4) is target always. + ;; I guess this makes it so the target/enemy events are always sent in the same order. + (when (= (-> c2 process type) target) + (swap! c1 c2)) + ;; send events! + (let ((c1-proc (handle->process (-> handles (+ 0 (* 2 i))))) + (c2-proc (handle->process (-> handles (+ 1 (* 2 i)))))) + (let ((v1-4 (-> c1 event-self))) (if v1-4 (send-event c1-proc v1-4 :from c2-proc entry))) + (let ((v1-5 (-> c1 event-other))) (if v1-5 (send-event c2-proc v1-5 :from c1-proc entry))) + (let ((v1-6 (-> c2 event-self))) (if v1-6 (send-event c2-proc v1-6 :from c1-proc entry))) + (let ((v1-7 (-> c2 event-other))) (if v1-7 (send-event c1-proc v1-7 :from c2-proc entry))))))) + (set! entry (-> (the-as (inline-array touching-shapes-entry) entry) 1))))) 0 - (none) - ) + (none)) (defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) "In a pair of collide shapes, is a prim from the given collide shape with the given prim-id mask touching the other shape?" @@ -520,29 +331,15 @@ ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) (while v1-1 - (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) - (return v1-1) - ) - (set! v1-1 (-> v1-1 next)) - ) - ) - ) + (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) (return v1-1)) + (set! v1-1 (-> v1-1 next))))) ((= (-> this cshape2) arg0) (let ((v1-4 (-> this head))) (while v1-4 - (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) - (return v1-4) - ) - (set! v1-4 (-> v1-4 next)) - ) - ) - ) - (else - (format 0 "ERROR: touching-shapes-entry::prims-touching? : Bogus cshape value!~%") - ) - ) - (the-as touching-prims-entry #f) - ) + (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) (return v1-4)) + (set! v1-4 (-> v1-4 next))))) + (else (format 0 "ERROR: touching-shapes-entry::prims-touching? : Bogus cshape value!~%"))) + (the-as touching-prims-entry #f)) (defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) "In a pair of collide shapes, find a pair of colliding prims where the prim from the given collide shape has at least one of the actions in arg1 @@ -552,81 +349,38 @@ (let ((v1-1 (-> this head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) - (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) - (return v1-1) - ) - ) - (set! v1-1 (-> v1-1 next)) - ) - ) - ) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) (return v1-1))) + (set! v1-1 (-> v1-1 next))))) ((= (-> this cshape2) arg0) (let ((v1-4 (-> this head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) - (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) - (return v1-4) - ) - ) - (set! v1-4 (-> v1-4 next)) - ) - ) - ) - (else - (format 0 "ERROR: touching-shapes-entry::prims-touching-action? : Bogus cshape value!~%") - ) - ) - (the-as touching-prims-entry #f) - ) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) (return v1-4))) + (set! v1-4 (-> v1-4 next))))) + (else (format 0 "ERROR: touching-shapes-entry::prims-touching-action? : Bogus cshape value!~%"))) + (the-as touching-prims-entry #f)) (defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) "Get the other shape in a pair of shapes." (cond - ((= (-> this cshape1) arg0) - (return (-> this cshape2)) - ) - ((= (-> this cshape2) arg0) - (return (-> this cshape1)) - ) - ) - (the-as collide-shape #f) - ) + ((= (-> this cshape1) arg0) (return (-> this cshape2))) + ((= (-> this cshape2) arg0) (return (-> this cshape1)))) + (the-as collide-shape #f)) (defmethod get-touched-prim ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) "Get the primitive belonging to the collide shape that is touching." (cond - ((= (-> arg1 cshape1) arg0) - (return (-> this prim1 cprim)) - ) - ((= (-> arg1 cshape2) arg0) - (return (-> this prim2 cprim)) - ) - ) - (the-as collide-shape-prim #f) - ) + ((= (-> arg1 cshape1) arg0) (return (-> this prim1 cprim))) + ((= (-> arg1 cshape2) arg0) (return (-> this prim2 cprim)))) + (the-as collide-shape-prim #f)) (defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) "Get the triangle belonging to the the collide shape that is touching (if it has one, otherwise #f)" (let ((v0-0 (the-as collide-tri-result #f))) (cond - ((= (-> arg1 cshape1) arg0) - (let ((v1-2 (-> this prim1))) - (if (-> v1-2 has-tri?) - (set! v0-0 (-> v1-2 tri)) - ) - ) - ) - ((= (-> arg1 cshape2) arg0) - (let ((v1-5 (-> this prim2))) - (if (-> v1-5 has-tri?) - (set! v0-0 (-> v1-5 tri)) - ) - ) - ) - ) - v0-0 - ) - ) + ((= (-> arg1 cshape1) arg0) (let ((v1-2 (-> this prim1))) (if (-> v1-2 has-tri?) (set! v0-0 (-> v1-2 tri))))) + ((= (-> arg1 cshape2) arg0) (let ((v1-5 (-> this prim2))) (if (-> v1-5 has-tri?) (set! v0-0 (-> v1-5 tri)))))) + v0-0)) (defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) "This is a bit weird... @@ -634,27 +388,12 @@ that is inside of both spheres, and get the midpoint of that." (let* ((s4-0 (-> this prim1 cprim)) (s3-0 (-> this prim2 cprim)) - ;; compute the offset between the prim cores. - (gp-1 (vector-! - (new 'stack-no-clear 'vector) - (the-as vector (-> s3-0 prim-core)) - (the-as vector (-> s4-0 prim-core)) - ) - ) - ) - + (gp-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> s3-0 prim-core)) (the-as vector (-> s4-0 prim-core))))) ;; subtract off the two radius. this is now the offset between the "closest" points (and is negative) (let ((f1-2 (- (- (vector-length gp-1) (-> s3-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) ;; this offset is the radius, minus half the overlap distance - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) - ) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2)))) ;; so add it to s4's origin to get to the halfway point - (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) - ) - arg0 - ) - - - - + (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core)))) + arg0) diff --git a/goal_src/jak1/engine/collide/collide.gc b/goal_src/jak1/engine/collide/collide.gc index deea39d0b8..ea22f2175c 100644 --- a/goal_src/jak1/engine/collide/collide.gc +++ b/goal_src/jak1/engine/collide/collide.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "kernel-defs.gc") ;; name: collide.gc @@ -10,23 +9,21 @@ ;; DECOMP BEGINS -(define *collide-vif0-init* (the-as (array uint32) (new 'static 'boxed-array :type uint32 - #x30000000 - #x4d000000 - #x4d000000 - #x4d000000 - #x3f800000 - #x5000001 - #x20000000 - #x40404040 - #x1000404 - #x0 - #x0 - #x0 - ) - ) - ) - - - - +(define *collide-vif0-init* + (the-as (array uint32) + (new 'static + 'boxed-array + :type + uint32 + #x30000000 + #x4d000000 + #x4d000000 + #x4d000000 + #x3f800000 + #x5000001 + #x20000000 + #x40404040 + #x1000404 + #x0 + #x0 + #x0))) diff --git a/goal_src/jak1/engine/collide/main-collide.gc b/goal_src/jak1/engine/collide/main-collide.gc index 47cde0991d..cfa3287a55 100644 --- a/goal_src/jak1/engine/collide/main-collide.gc +++ b/goal_src/jak1/engine/collide/main-collide.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/math/vector-h.gc") (require "engine/gfx/tie/tie-h.gc") (require "engine/ps2/vu1-macros.gc") @@ -17,79 +16,67 @@ ;; Used lq/sq (defun drawable-sphere-box-intersect? ((arg0 drawable) (arg1 bounding-box4w)) (local-vars - (r0-0 int) - (r0-1 int) - (r0-2 uint128) - (r0-3 int) - (v1-1 uint128) - (v1-2 uint128) - (v1-3 uint128) - (a0-1 uint128) - (a1-2 uint128) - (a2-0 uint128) - (f31-0 none) - ) + (r0-0 int) + (r0-1 int) + (r0-2 uint128) + (r0-3 int) + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (a0-1 uint128) + (a1-2 uint128) + (a2-0 uint128) + (f31-0 none)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) - (vf4 :class vf) - ) - (nop!) - (nop!) - (.lvf vf1 (&-> arg0 bsphere quad)) - (.add.w.vf vf2 vf1 vf1 :mask #b111) - (let ((v1-0 (-> arg1 min quad))) - (.sub.w.vf vf1 vf1 vf1 :mask #b111) - (let ((a1-1 (-> arg1 max quad))) - (.ftoi.vf vf4 vf2) - (nop!) - (.ftoi.vf vf3 vf1) - (nop!) - (.mov a0-1 vf4) - (nop!) - (.mov a2-0 vf3) - (nop!) - (.pcgtw a1-2 a2-0 a1-1) - ) - (.mov r0-0 f31-0) - (.pcgtw v1-1 v1-0 a0-1) - ) - (.mov r0-1 f31-0) - (.por v1-2 a1-2 v1-1) - (.mov r0-2 f31-0) - (.ppach v1-3 r0-2 v1-2) - (.mov r0-3 f31-0) - (let ((v1-4 (shl (the-as int v1-3) 16))) + (vf4 :class vf)) (nop!) - (zero? v1-4) - ) - ) - ) + (nop!) + (.lvf vf1 (&-> arg0 bsphere quad)) + (.add.w.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-0 (-> arg1 min quad))) + (.sub.w.vf vf1 vf1 vf1 :mask #b111) + (let ((a1-1 (-> arg1 max quad))) + (.ftoi.vf vf4 vf2) + (nop!) + (.ftoi.vf vf3 vf1) + (nop!) + (.mov a0-1 vf4) + (nop!) + (.mov a2-0 vf3) + (nop!) + (.pcgtw a1-2 a2-0 a1-1)) + (.mov r0-0 f31-0) + (.pcgtw v1-1 v1-0 a0-1)) + (.mov r0-1 f31-0) + (.por v1-2 a1-2 v1-1) + (.mov r0-2 f31-0) + (.ppach v1-3 r0-2 v1-2) + (.mov r0-3 f31-0) + (let ((v1-4 (shl (the-as int v1-3) 16))) (nop!) (zero? v1-4)))) ;; definition for function instance-sphere-box-intersect? ;; WARN: Function may read a register that is not set: f31 ;; Used lq/sq -(defun - instance-sphere-box-intersect? - ((arg0 drawable) (arg1 instance-tie) (arg2 bounding-box4w)) +(defun instance-sphere-box-intersect? ((arg0 drawable) (arg1 instance-tie) (arg2 bounding-box4w)) (local-vars - (zero uint128) - (v1-3 uint128) - (v1-4 uint128) - (v1-5 uint128) - (a0-2 uint128) - (a1-2 uint128) - (a2-1 uint128) - (a3-1 uint128) - (a3-3 uint128) - (a3-4 uint128) - (t0-1 uint128) - (t0-2 uint128) - (t1-0 uint128) - (t2-1 uint128) - (t2-2 uint128) - (f31-0 none) - ) + (zero uint128) + (v1-3 uint128) + (v1-4 uint128) + (v1-5 uint128) + (a0-2 uint128) + (a1-2 uint128) + (a2-1 uint128) + (a3-1 uint128) + (a3-3 uint128) + (a3-4 uint128) + (t0-1 uint128) + (t0-2 uint128) + (t1-0 uint128) + (t2-1 uint128) + (t2-2 uint128) + (f31-0 none)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -101,86 +88,73 @@ (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) - (vf9 :class vf) - ) - (init-vf0-vector) - (nop!) - (let ((v1-0 (-> arg1 max-scale))) + (vf9 :class vf)) + (init-vf0-vector) (nop!) - (let ((a3-0 (the-as uint128 (-> arg1 origin vector4h 3 long)))) - (nop!) - (let ((t2-0 (the-as uint128 (-> arg1 origin vector4h 0 long)))) - (.pextlh a3-1 a3-0 zero) - (let ((t0-0 (the-as uint128 (-> arg1 origin vector4h 1 long)))) - (.pw.sra t1-0 a3-1 10) - (let ((a3-2 (the-as uint128 (-> arg1 origin vector4h 2 long)))) - (.pextlh t2-1 t2-0 zero) - (.pw.sra t2-2 t2-1 16) - (.pextlh t0-1 t0-0 zero) - (.mov vf8 t1-0) - (.pw.sra t0-2 t0-1 16) - (.mov vf5 t2-2) - (.pextlh a3-3 a3-2 zero) - ) - ) - ) - ) - (.mov vf6 t0-2) - (.pw.sra a3-4 a3-3 16) - (.lvf vf9 (&-> arg1 bsphere quad)) + (let ((v1-0 (-> arg1 max-scale))) + (nop!) + (let ((a3-0 (the-as uint128 (-> arg1 origin vector4h 3 long)))) + (nop!) + (let ((t2-0 (the-as uint128 (-> arg1 origin vector4h 0 long)))) + (.pextlh a3-1 a3-0 zero) + (let ((t0-0 (the-as uint128 (-> arg1 origin vector4h 1 long)))) + (.pw.sra t1-0 a3-1 10) + (let ((a3-2 (the-as uint128 (-> arg1 origin vector4h 2 long)))) + (.pextlh t2-1 t2-0 zero) + (.pw.sra t2-2 t2-1 16) + (.pextlh t0-1 t0-0 zero) + (.mov vf8 t1-0) + (.pw.sra t0-2 t0-1 16) + (.mov vf5 t2-2) + (.pextlh a3-3 a3-2 zero))))) + (.mov vf6 t0-2) + (.pw.sra a3-4 a3-3 16) + (.lvf vf9 (&-> arg1 bsphere quad)) + (nop!) + (.mov vf7 a3-4) + (nop!) + (.mov vf10 v1-0)) + (.itof.vf vf8 vf8) (nop!) - (.mov vf7 a3-4) + (vitof12.xyzw vf5 vf5) (nop!) - (.mov vf10 v1-0) - ) - (.itof.vf vf8 vf8) - (nop!) - (vitof12.xyzw vf5 vf5) - (nop!) - (vitof12.xyzw vf6 vf6) - (nop!) - (vitof12.xyzw vf7 vf7) - (nop!) - (.add.vf vf8 vf8 vf9 :mask #b111) - (nop!) - (nop!) - (.lvf vf9 (&-> arg0 bsphere quad)) - (vitof12.xyzw vf10 vf10) - (nop!) - (.mul.w.vf vf10 vf10 vf9 :mask #b1) - (nop!) - (.mul.x.vf acc vf5 vf9) - (nop!) - (.add.mul.y.vf acc vf6 vf9 acc) - (let ((v1-2 (-> arg2 min quad))) - (.add.mul.z.vf acc vf7 vf9 acc) - (let ((a1-1 (-> arg2 max quad))) - (.add.mul.w.vf vf1 vf8 vf0 acc) - (nop!) - (.add.x.vf vf2 vf1 vf10 :mask #b111) - (nop!) - (.sub.x.vf vf1 vf1 vf10 :mask #b111) - (nop!) - (.ftoi.vf vf4 vf2) - (nop!) - (.ftoi.vf vf3 vf1) - (nop!) - (.mov a0-2 vf4) - (nop!) - (.mov a2-1 vf3) - (nop!) - (.pcgtw a1-2 a2-1 a1-1) - ) - (.pcgtw v1-3 v1-2 a0-2) - ) - (.por v1-4 a1-2 v1-3) - (.ppach v1-5 zero v1-4) - (let ((v1-6 (shl (the-as int v1-5) 16))) + (vitof12.xyzw vf6 vf6) (nop!) - (zero? v1-6) - ) - ) - ) + (vitof12.xyzw vf7 vf7) + (nop!) + (.add.vf vf8 vf8 vf9 :mask #b111) + (nop!) + (nop!) + (.lvf vf9 (&-> arg0 bsphere quad)) + (vitof12.xyzw vf10 vf10) + (nop!) + (.mul.w.vf vf10 vf10 vf9 :mask #b1) + (nop!) + (.mul.x.vf acc vf5 vf9) + (nop!) + (.add.mul.y.vf acc vf6 vf9 acc) + (let ((v1-2 (-> arg2 min quad))) + (.add.mul.z.vf acc vf7 vf9 acc) + (let ((a1-1 (-> arg2 max quad))) + (.add.mul.w.vf vf1 vf8 vf0 acc) + (nop!) + (.add.x.vf vf2 vf1 vf10 :mask #b111) + (nop!) + (.sub.x.vf vf1 vf1 vf10 :mask #b111) + (nop!) + (.ftoi.vf vf4 vf2) + (nop!) + (.ftoi.vf vf3 vf1) + (nop!) + (.mov a0-2 vf4) + (nop!) + (.mov a2-1 vf3) + (nop!) + (.pcgtw a1-2 a2-1 a1-1)) + (.pcgtw v1-3 v1-2 a0-2)) + (.por v1-4 a1-2 v1-3) + (.ppach v1-5 zero v1-4) + (let ((v1-6 (shl (the-as int v1-5) 16))) (nop!) (zero? v1-6)))) ;; definition for function instance-tfragment-add-debug-sphere ;; Used lq/sq @@ -190,37 +164,25 @@ (vf10 :class vf) (vf11 :class vf) (vf12 :class vf) - (vf9 :class vf) - ) - (init-vf0-vector) - (nop!) - (let ((v1-0 (the-as uint128 (-> arg1 origin vector4h 3 long)))) - (.pextlh v1-1 v1-0 r0-0) - ) - (.lvf vf9 (&-> arg0 bsphere quad)) - (.pw.sra v1-2 v1-1 10) - (.lvf vf10 (&-> arg1 bsphere quad)) - (nop!) - (.mov vf12 v1-2) - (.itof.vf vf12 vf12) - (nop!) - (.add.vf vf10 vf10 vf12 :mask #b111) - (nop!) - (.add.vf vf9 vf9 vf10 :mask #b111) - (nop!) - (.add.w.vf vf11 vf0 vf9 :mask #b1) - (nop!) - (.mov a3-0 vf11) - (nop!) - (let ((a2-0 (new-stack-vector0))) - (.svf (&-> a2-0 quad) vf9) - (add-debug-sphere - #t - (bucket-id debug) - a2-0 - a3-0 - (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - ) - ) - ) - ) + (vf9 :class vf)) + (init-vf0-vector) + (nop!) + (let ((v1-0 (the-as uint128 (-> arg1 origin vector4h 3 long)))) (.pextlh v1-1 v1-0 r0-0)) + (.lvf vf9 (&-> arg0 bsphere quad)) + (.pw.sra v1-2 v1-1 10) + (.lvf vf10 (&-> arg1 bsphere quad)) + (nop!) + (.mov vf12 v1-2) + (.itof.vf vf12 vf12) + (nop!) + (.add.vf vf10 vf10 vf12 :mask #b111) + (nop!) + (.add.vf vf9 vf9 vf10 :mask #b111) + (nop!) + (.add.w.vf vf11 vf0 vf9 :mask #b1) + (nop!) + (.mov a3-0 vf11) + (nop!) + (let ((a2-0 (new-stack-vector0))) + (.svf (&-> a2-0 quad) vf9) + (add-debug-sphere #t (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80))))) diff --git a/goal_src/jak1/engine/collide/pat-h.gc b/goal_src/jak1/engine/collide/pat-h.gc index e03154cadd..aec301a2af 100644 --- a/goal_src/jak1/engine/collide/pat-h.gc +++ b/goal_src/jak1/engine/collide/pat-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/math/math.gc") ;; name: pat-h.gc @@ -32,15 +31,13 @@ (swamp) (stopproj) (rotate) - (neutral) - ) + (neutral)) (defenum pat-mode :type uint8 (ground) (wall) - (obstacle) - ) + (obstacle)) (defenum pat-event :type uint8 @@ -50,8 +47,7 @@ (burn) (deadlyup) (burnup) - (melt) - ) + (melt)) ;; DECOMP BEGINS @@ -59,65 +55,67 @@ ;; It packs all data into a 32-bit pat-surface type. (deftype pat-surface (uint32) - ((skip uint8 :offset 0 :size 3) - (mode pat-mode :offset 3 :size 3) - (material pat-material :offset 6 :size 6) - (camera uint8 :offset 12 :size 2) - (event pat-event :offset 14 :size 6) - (noentity uint8 :offset 0 :size 1) - (nocamera uint8 :offset 1 :size 1) - (noedge uint8 :offset 2 :size 1) - (nolineofsight uint8 :offset 12 :size 1) - (unknown-bit uint8 :offset 15 :size 1) - ) - ) + ((skip uint8 :offset 0 :size 3) + (mode pat-mode :offset 3 :size 3) + (material pat-material :offset 6 :size 6) + (camera uint8 :offset 12 :size 2) + (event pat-event :offset 14 :size 6) + (noentity uint8 :offset 0 :size 1) + (nocamera uint8 :offset 1 :size 1) + (noedge uint8 :offset 2 :size 1) + (nolineofsight uint8 :offset 12 :size 1) + (unknown-bit uint8 :offset 15 :size 1))) (defun-debug pat-material->string ((pat pat-surface)) - (enum->string pat-material (-> pat material)) - ) + (enum->string pat-material (-> pat material))) (defun-debug pat-mode->string ((pat pat-surface)) - (enum->string pat-mode (-> pat mode)) - ) + (enum->string pat-mode (-> pat mode))) (defun-debug pat-event->string ((pat pat-surface)) - (enum->string pat-event (-> pat event)) - ) + (enum->string pat-event (-> pat event))) ;; for debug drawing pat's by mode. (deftype pat-mode-info (structure) - ((name string) - (wall-angle float) - (color rgba) - (hilite-color rgba) - ) - ) + ((name string) + (wall-angle float) + (color rgba) + (hilite-color rgba))) - -(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4 - (new 'static 'pat-mode-info - :name "ground" - :wall-angle 0.2 - :color (new 'static 'rgba :r #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :a #x80) - ) - (new 'static 'pat-mode-info - :name "wall" - :wall-angle 2.0 - :color (new 'static 'rgba :b #x7f :a #x40) - :hilite-color (new 'static 'rgba :b #xff :a #x80) - ) - (new 'static 'pat-mode-info - :name "obstacle" - :wall-angle 0.82 - :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) - ) - (new 'static 'pat-mode-info - :name "pole" - :wall-angle 2.0 - :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) - ) - ) - ) +(define *pat-mode-info* + (new 'static + 'inline-array + pat-mode-info + 4 + (new 'static + 'pat-mode-info + :name "ground" + :wall-angle 0.2 + :color + (new 'static 'rgba :r #x7f :a #x40) + :hilite-color + (new 'static 'rgba :r #xff :a #x80)) + (new 'static + 'pat-mode-info + :name "wall" + :wall-angle 2.0 + :color + (new 'static 'rgba :b #x7f :a #x40) + :hilite-color + (new 'static 'rgba :b #xff :a #x80)) + (new 'static + 'pat-mode-info + :name "obstacle" + :wall-angle 0.82 + :color + (new 'static 'rgba :r #x7f :b #x7f :a #x40) + :hilite-color + (new 'static 'rgba :r #xff :b #xff :a #x80)) + (new 'static + 'pat-mode-info + :name "pole" + :wall-angle 2.0 + :color + (new 'static 'rgba :r #x7f :g #x7f :a #x40) + :hilite-color + (new 'static 'rgba :r #xff :g #xff :a #x80)))) diff --git a/goal_src/jak1/engine/collide/surface-h.gc b/goal_src/jak1/engine/collide/surface-h.gc index 0d1e460849..ae7b3de18e 100644 --- a/goal_src/jak1/engine/collide/surface-h.gc +++ b/goal_src/jak1/engine/collide/surface-h.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "kernel/gcommon.gc") ;; name: surface-h.gc @@ -12,10 +11,9 @@ :bitfield #t :type uint32 (allow-look-around) ;; allows entering first person with triangle - (dive) ;; set on all diving (dive, dive-bottom) surfaces - (surf02) ;; unused - (no-turn-around) ;; prevent "changed direction" animation from happening - + (dive) ;; set on all diving (dive, dive-bottom) surfaces + (surf02) ;; unused + (no-turn-around) ;; prevent "changed direction" animation from happening ;; when jak is on a surface with this flag, the case where jak ;; is forced to rotate in the direction he's traveling is ;; never taken. It's used on ice (though it is not needed, the turn toward transv @@ -25,10 +23,8 @@ ;; if jak should always be forced to rotate in the direction he's travelling. ;; used for the slides and also the warp gate jump (always-rotate-toward-transv) - ;; never set, but prevents jak from jumping (both normal and roll) (prevent-jump) - ;; target is launch jumping (from a blue eco pad) (prevent-attacks-during-launch-jump) (surf08) ;; never set, prevents various attacks from being possible @@ -36,7 +32,7 @@ (allow-edge-grab) ;; if set, and jak is falling, turn on the ledge grab search. (jump) ;; set on all jumps, used to prevent "on-grounds" in places (attacking) ;; set on all attacks, but not actually used anywhere - (ducking) ;; set on all ducks, but not actually used anywhere + (ducking) ;; set on all ducks, but not actually used anywhere (moving-ground) ;; unused, but would make sense if jak was on something moving ) @@ -54,1199 +50,1144 @@ ;; Note that "surface" can apply to weird things, like riding the zoomer or swimming as well. (deftype surface (basic) - ((name symbol) - (turnv float) - (turnvv float) - (tiltv float) - (tiltvv float) - (transv-max float) - (target-speed float) - (seek0 float) - (seek90 float) - (seek180 float) - (fric float) - (nonlin-fric-dist float) - (slip-factor float) - (slide-factor float) - (slope-up-factor float) - (slope-down-factor float) - (slope-slip-angle float) - (impact-fric float) - (bend-factor float) - (bend-speed float) - (alignv float) - (slope-up-traction float) - (align-speed float) - (active-hook (function none) :offset 128) - (touch-hook (function none)) - (impact-hook function) - (mult-hook (function surface surface surface int none)) - (mode symbol) - (flags surface-flags) - (data float 30 :overlay-at turnv) - (hook function 4 :overlay-at active-hook) - (dataw uint32 2 :overlay-at mode) - ) - ) + ((name symbol) + (turnv float) + (turnvv float) + (tiltv float) + (tiltvv float) + (transv-max float) + (target-speed float) + (seek0 float) + (seek90 float) + (seek180 float) + (fric float) + (nonlin-fric-dist float) + (slip-factor float) + (slide-factor float) + (slope-up-factor float) + (slope-down-factor float) + (slope-slip-angle float) + (impact-fric float) + (bend-factor float) + (bend-speed float) + (alignv float) + (slope-up-traction float) + (align-speed float) + (active-hook (function none) :offset 128) + (touch-hook (function none)) + (impact-hook function) + (mult-hook (function surface surface surface int none)) + (mode symbol) + (flags surface-flags) + (data float 30 :overlay-at turnv) + (hook function 4 :overlay-at active-hook) + (dataw uint32 2 :overlay-at mode))) ;; these calc-terminal functions are unused. (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) - ) + (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1)) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) - (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) - ) - ) + (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))))) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) - (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) - ) - ) + (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))))) (defmethod print ((this surface)) ;; seems this format string is wrong. - (format - #t - "# this turnv) - (-> this turnvv) - (-> this tiltv) - (-> this tiltvv) - (-> this transv-max) - ) + (format #t + "# this turnv) + (-> this turnvv) + (-> this tiltv) + (-> this tiltvv) + (-> this transv-max)) (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this) - this - ) + this) (defun surface-interp! ((dst surface) (src0 surface) (src1 surface) (amount float)) "Create a surface between src0 and src1. For things like hooks/mode, src1 wins." - ;; iterate through surface data (dotimes (v1-0 30) ;; interpolate between the two - (set! (-> dst data v1-0) (+ (* (-> src1 data v1-0) amount) (* (-> src0 data v1-0) (- 1.0 amount)))) - ) - + (set! (-> dst data v1-0) (+ (* (-> src1 data v1-0) amount) (* (-> src0 data v1-0) (- 1.0 amount))))) ;; iterate through hooks. Check src1, then src0 for a nonzero and non-nothing hook. ;; if there is no good hook, set it to nothing. (dotimes (v1-3 4) - (set! (-> dst hook v1-3) (cond - ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) - (-> src1 hook v1-3) - ) - ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) - (-> src0 hook v1-3) - ) - (else - nothing - ) - ) - ) - ) - + (set! (-> dst hook v1-3) + (cond + ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) (-> src1 hook v1-3)) + ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) (-> src0 hook v1-3)) + (else nothing)))) ;; just use the dataw's from src1 (dotimes (v1-6 2) - (set! (-> dst dataw v1-6) (-> src1 dataw v1-6)) - ) - dst - ) + (set! (-> dst dataw v1-6) (-> src1 dataw v1-6))) + dst) (defun surface-mult! ((dst surface) (src0 surface) (src1 surface)) "Multiply src0 by src1, and store the result in dst." - (dotimes (v1-0 30) - (set! (-> dst data v1-0) (* (-> src1 data v1-0) (-> src0 data v1-0))) - ) + (set! (-> dst data v1-0) (* (-> src1 data v1-0) (-> src0 data v1-0)))) (dotimes (v1-3 4) - (set! (-> dst hook v1-3) (cond - ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) - (-> src1 hook v1-3) - ) - ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) - (-> src0 hook v1-3) - ) - (else - nothing - ) - ) - ) - ) + (set! (-> dst hook v1-3) + (cond + ((and (nonzero? (-> src1 hook v1-3)) (!= (-> src1 hook v1-3) nothing)) (-> src1 hook v1-3)) + ((and (nonzero? (-> src0 hook v1-3)) (!= (-> src0 hook v1-3) nothing)) (-> src0 hook v1-3)) + (else nothing)))) (dotimes (v1-6 2) - (set! (-> dst dataw v1-6) (-> src1 dataw v1-6)) - ) + (set! (-> dst dataw v1-6) (-> src1 dataw v1-6))) ;; take the or of the flags, I guess (set! (-> dst flags) (logior (-> src0 flags) (-> src1 flags))) ;; and call the mult-hook ((-> dst mult-hook) dst src0 src1 1) - dst - ) + dst) (defun surface-clamp-speed ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) "When arg3 is 1, clamp speed of arg0 to the mins of arg0/arg1" (when (= arg3 1) (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> arg1 transv-max))) - (set! (-> arg0 target-speed) (fmin (-> arg0 target-speed) (-> arg1 target-speed))) - ) - (none) - ) + (set! (-> arg0 target-speed) (fmin (-> arg0 target-speed) (-> arg1 target-speed)))) + (none)) ;; The common surfaces: -(define *walk-mods* (new 'static 'surface - :name 'run - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags (surface-flags allow-look-around) - ) - ) +(define *walk-mods* + (new 'static + 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags + (surface-flags allow-look-around))) -(define *walk-no-turn-mods* (new 'static 'surface - :name 'run - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(define *walk-no-turn-mods* + (new 'static + 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0)) -(define *turn-around-mods* (new 'static 'surface - :name 'run - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :fric 0.1 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(define *turn-around-mods* + (new 'static + 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0)) -(let ((a0-3 (new 'static 'surface - :name 'duck - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 291271.12 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags (surface-flags ducking) - ) - ) - ) +(let ((a0-3 (new 'static + 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 291271.12 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags + (surface-flags ducking)))) (set! (-> a0-3 mult-hook) surface-clamp-speed) ;; og:preserve-this - (define *duck-mods* a0-3) - ) + (define *duck-mods* a0-3)) -(define *duck-attack-mods* (new 'static 'surface - :name 'duck - :tiltv 65536.0 - :tiltvv 291271.12 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags (surface-flags attacking ducking) - ) - ) +(define *duck-attack-mods* + (new 'static + 'surface + :name 'duck + :tiltv 65536.0 + :tiltvv 291271.12 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags + (surface-flags attacking ducking))) -(define *jump-mods* (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *jump-mods* + (new 'static + 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *double-jump-mods* (new 'static 'surface - :name 'jump-double - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 32768.0 - :target-speed 32768.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *double-jump-mods* + (new 'static + 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *smack-jump-mods* (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *smack-jump-mods* + (new 'static + 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *high-jump-mods* (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 26624.0 - :target-speed 26624.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *high-jump-mods* + (new 'static + 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 26624.0 + :target-speed 26624.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *launch-jump-mods* (new 'static 'surface - :name 'launch-jump - :turnv 18204.445 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 61440.0 - :target-speed 61440.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags prevent-attacks-during-launch-jump allow-edge-grab jump) - ) - ) +(define *launch-jump-mods* + (new 'static + 'surface + :name 'launch-jump + :turnv 18204.445 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 61440.0 + :target-speed 61440.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags prevent-attacks-during-launch-jump allow-edge-grab jump))) -(define *forward-high-jump-mods* (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 45056.0 - :target-speed 45056.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *forward-high-jump-mods* + (new 'static + 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 45056.0 + :target-speed 45056.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *flip-jump-mods* (new 'static 'surface - :name 'high-jump - :turnv 131072.0 - :turnvv 65536.0 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 80281.6 - :target-speed 51200.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.3 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *flip-jump-mods* + (new 'static + 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 80281.6 + :target-speed 51200.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *forward-jump-mods* (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 65536.0 - :target-speed 65536.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *forward-jump-mods* + (new 'static + 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *forward-pole-jump-mods* (new 'static 'surface - :name 'jump - :turnv 131072.0 - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 53248.0 - :target-speed 53248.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump) - ) - ) +(define *forward-pole-jump-mods* + (new 'static + 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 53248.0 + :target-speed 53248.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump))) -(define *attack-mods* (new 'static 'surface - :name 'attack - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags (surface-flags attacking) - ) - ) +(define *attack-mods* + (new 'static + 'surface + :name 'attack + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags + (surface-flags attacking))) -(define *jump-attack-mods* (new 'static 'surface - :name 'attack - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 24576.0 - :target-speed 24576.0 - :seek0 0.9 - :seek90 0.9 - :seek180 0.9 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump attacking) - ) - ) +(define *jump-attack-mods* + (new 'static + 'surface + :name 'attack + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump attacking))) -(let ((a0-4 (new 'static 'surface - :name 'uppercut - :turnvv 18204.445 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 32768.0 - :target-speed 32768.0 - :seek0 0.3 - :seek90 0.3 - :seek180 0.3 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags allow-edge-grab jump attacking) - ) - ) - ) +(let ((a0-4 (new 'static + 'surface + :name 'uppercut + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags allow-edge-grab jump attacking)))) (set! (-> a0-4 mult-hook) surface-clamp-speed) ;; og:preserve-this - (define *uppercut-jump-mods* a0-4) - ) + (define *uppercut-jump-mods* a0-4)) -(define *run-attack-mods* (new 'static 'surface - :name 'wheel-flip - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 122880.0 - :seek90 0.5 - :seek180 0.15 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - ;; no-rotate-toward-transv prevents jak from spinning around - ;; if you punch over bumpy terrain - :flags (surface-flags no-turn-around no-rotate-toward-transv attacking) - ) - ) +(define *run-attack-mods* + (new 'static + 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + ;; no-rotate-toward-transv prevents jak from spinning around + ;; if you punch over bumpy terrain + :flags + (surface-flags no-turn-around no-rotate-toward-transv attacking))) -(define *wheel-mods* (new 'static 'surface - :name 'wheel - :turnv 131072.0 - :turnvv 5461.3335 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 11468.8 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags (surface-flags attacking) - ) - ) +(define *wheel-mods* + (new 'static + 'surface + :name 'wheel + :turnv 131072.0 + :turnvv 5461.3335 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 11468.8 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags + (surface-flags attacking))) -(define *wheel-flip-mods* (new 'static 'surface - :name 'wheel-flip - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 91750.4 - :target-speed 103219.195 - :seek90 0.5 - :seek180 0.15 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags (surface-flags allow-edge-grab jump attacking) - ) - ) +(define *wheel-flip-mods* + (new 'static + 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 91750.4 + :target-speed 103219.195 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags + (surface-flags allow-edge-grab jump attacking))) -(define *flop-mods* (new 'static 'surface - :name 'flop - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 0.3 - :seek180 1.5 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'attack - :flags (surface-flags jump attacking) - ) - ) +(define *flop-mods* + (new 'static + 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags + (surface-flags jump attacking))) -(let ((a0-5 (new 'static 'surface - :name 'flop - :turnv 9102.223 - :turnvv 9102.223 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 0.3 - :seek90 0.1 - :seek180 0.15 - :fric 0.2 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 0.25 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags jump) - ) - ) - ) +(let ((a0-5 (new 'static + 'surface + :name 'flop + :turnv 9102.223 + :turnvv 9102.223 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.1 + :seek180 0.15 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags + (surface-flags jump)))) (set! (-> a0-5 mult-hook) surface-clamp-speed) ;; og:preserve-this - (define *flop-land-mods* a0-5) - ) + (define *flop-land-mods* a0-5)) -(define *wade-mods* (new 'static 'surface - :name 'wade - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :seek0 1.0 - :seek90 0.5 - :seek180 0.5 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'wade - :flags (surface-flags allow-look-around) - ) - ) +(define *wade-mods* + (new 'static + 'surface + :name 'wade + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'wade + :flags + (surface-flags allow-look-around))) -(define *swim-mods* (new 'static 'surface - :name 'swim - :turnv 49152.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 28672.0 - :target-speed 28672.0 - :seek0 0.75 - :seek90 0.2 - :seek180 0.2 - :fric 0.05 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'swim - ) - ) +(define *swim-mods* + (new 'static + 'surface + :name 'swim + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 28672.0 + :target-speed 28672.0 + :seek0 0.75 + :seek90 0.2 + :seek180 0.2 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'swim)) -(define *dive-mods* (new 'static 'surface - :name 'swim - :turnv 21845.334 - :turnvv 32768.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 20480.0 - :target-speed 20480.0 - :seek0 0.05 - :seek90 0.05 - :seek180 0.05 - :fric 1.0 - :nonlin-fric-dist 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :align-speed 1.0 - :mode 'dive - :flags (surface-flags dive) - ) - ) +(define *dive-mods* + (new 'static + 'surface + :name 'swim + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :align-speed 1.0 + :mode 'dive + :flags + (surface-flags dive))) -(define *dive-bottom-mods* (new 'static 'surface - :name 'swim-bottom - :turnv 21845.334 - :turnvv 32768.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 20480.0 - :target-speed 20480.0 - :seek0 0.1 - :seek90 0.05 - :seek180 0.05 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'dive - :flags (surface-flags dive) - ) - ) +(define *dive-bottom-mods* + (new 'static + 'surface + :name 'swim-bottom + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.1 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'dive + :flags + (surface-flags dive))) (let ((a0-7 (copy *walk-mods* 'global))) (set! (-> a0-7 name) 'pole) (set! (-> a0-7 flags) (surface-flags)) ;; og:preserve-this - (define *pole-mods* a0-7) - ) + (define *pole-mods* a0-7)) (let ((a0-9 (copy *walk-mods* 'global))) (set! (-> a0-9 name) 'grab) (set! (-> a0-9 flags) (surface-flags)) ;; og:preserve-this - (define *grab-mods* a0-9) - ) + (define *grab-mods* a0-9)) (let ((a0-11 (copy *walk-mods* 'global))) (set! (-> a0-11 name) 'edge-grab) (set! (-> a0-11 flags) (surface-flags)) ;; og:preserve-this - (define *edge-grab-mods* a0-11) - ) + (define *edge-grab-mods* a0-11)) (define *empty-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) -(define *neutral-mods* (new 'static 'surface - :name 'walk - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 131072.0 - :transv-max 40960.0 - :target-speed 40960.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) +(define *neutral-mods* + (new 'static + 'surface + :name 'walk + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :slope-up-traction 1.0 + :align-speed 1.0)) -(let ((v1-41 (new 'static 'surface - :name '*stone-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 153600.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) - ) +(let ((v1-41 (new 'static + 'surface + :name '*stone-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0))) (define *stone-surface* v1-41) (set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-41 touch-hook) nothing) - (set! (-> v1-41 active-hook) nothing) - ) + (set! (-> v1-41 active-hook) nothing)) -(let ((v1-42 (new 'static 'surface - :name '*edge-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 30720.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 18432.0 - :slope-slip-angle 8192.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :align-speed 1.0 - ) - ) - ) +(let ((v1-42 (new 'static + 'surface + :name '*edge-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 30720.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 18432.0 + :slope-slip-angle 8192.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0))) ;; og:preserve-this (define *edge-surface* v1-42) (set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-42 touch-hook) nothing) - (set! (-> v1-42 active-hook) nothing) - ) + (set! (-> v1-42 active-hook) nothing)) -(let ((v1-43 (new 'static 'surface - :name '*wade-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.7 - :target-speed 0.7 - :seek0 153600.0 - :seek90 153600.0 - :seek180 256000.0 - :fric 153600.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.6 - :slope-up-traction 1.0 - :align-speed 0.6 - ) - ) - ) +(let ((v1-43 (new 'static + 'surface + :name '*wade-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.6 + :slope-up-traction 1.0 + :align-speed 0.6))) ;; og:preserve-this (define *wade-surface* v1-43) (set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-43 touch-hook) nothing) - (set! (-> v1-43 active-hook) nothing) - ) + (set! (-> v1-43 active-hook) nothing)) -(let ((v1-44 (new 'static 'surface - :name '*slope-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 245760.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-up-factor 40960.0 - :slope-down-factor 8192.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 1.0 - :align-speed 1.0 - ) - ) - ) +(let ((v1-44 (new 'static + 'surface + :name '*slope-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 245760.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-up-factor 40960.0 + :slope-down-factor 8192.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0))) ;; og:preserve-this (define *slope-surface* v1-44) (set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-44 touch-hook) nothing) - (set! (-> v1-44 active-hook) nothing) - ) + (set! (-> v1-44 active-hook) nothing)) -(let ((v1-45 (new 'static 'surface - :name '*quicksand-surface* - :turnv 0.25 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.5 - :target-speed 0.5 - :seek0 81920.0 - :seek90 83968.0 - :seek180 165888.0 - :fric 329728.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.5 - :slope-up-traction 1.0 - :align-speed 0.5 - ) - ) - ) +(let ((v1-45 (new 'static + 'surface + :name '*quicksand-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.5 + :target-speed 0.5 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5))) ;; og:preserve-this (define *quicksand-surface* v1-45) (set! (-> v1-45 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-45 touch-hook) nothing) - (set! (-> v1-45 active-hook) nothing) - ) + (set! (-> v1-45 active-hook) nothing)) -(let ((v1-46 (new 'static 'surface - :name '*tar-surface* - :turnv 0.25 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 0.4 - :target-speed 0.4 - :seek0 81920.0 - :seek90 83968.0 - :seek180 165888.0 - :fric 329728.0 - :nonlin-fric-dist 5120.0 - :slip-factor 1.0 - :slope-down-factor 10240.0 - :slope-slip-angle 8192.0 - :impact-fric 1.0 - :bend-factor 0.8 - :bend-speed 4.0 - :alignv 0.5 - :slope-up-traction 1.0 - :align-speed 0.5 - ) - ) - ) +(let ((v1-46 (new 'static + 'surface + :name '*tar-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.4 + :target-speed 0.4 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5))) ;; og:preserve-this (define *tar-surface* v1-46) (set! (-> v1-46 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-46 touch-hook) nothing) - (set! (-> v1-46 active-hook) nothing) - ) + (set! (-> v1-46 active-hook) nothing)) -(let ((v1-47 (new 'static 'surface - :name '*grass-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 122880.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-slip-angle 16384.0 - :impact-fric 0.5 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) - ) +(let ((v1-47 (new 'static + 'surface + :name '*grass-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 122880.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-slip-angle 16384.0 + :impact-fric 0.5 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0))) ;; og:preserve-this (define *grass-surface* v1-47) (set! (-> v1-47 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-47 touch-hook) nothing) - (set! (-> v1-47 active-hook) nothing) - ) + (set! (-> v1-47 active-hook) nothing)) -(let ((v1-48 (new 'static 'surface - :name '*ice-surface* - :turnv 0.5 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.5 - :target-speed 1.5 - :seek0 24576.0 - :seek90 24576.0 - :seek180 24576.0 - :fric 23756.8 - :nonlin-fric-dist 4091904.0 - :slip-factor 0.7 - :slope-slip-angle 16384.0 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :flags (surface-flags no-turn-around no-rotate-toward-transv) - ) - ) - ) +(let ((v1-48 (new 'static + 'surface + :name '*ice-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.5 + :target-speed 1.5 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slip-factor 0.7 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags + (surface-flags no-turn-around no-rotate-toward-transv)))) ;; og:preserve-this (define *ice-surface* v1-48) (set! (-> v1-48 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-48 touch-hook) nothing) - (set! (-> v1-48 active-hook) nothing) - ) + (set! (-> v1-48 active-hook) nothing)) -(let ((v1-49 (new 'static 'surface - :name '*tread-surface* - :turnv 1.0 - :turnvv 1.0 - :tiltv 1.0 - :tiltvv 1.0 - :transv-max 1.0 - :target-speed 1.0 - :seek0 122880.0 - :seek90 245760.0 - :seek180 409600.0 - :fric 122880.0 - :nonlin-fric-dist 4096.0 - :slip-factor 1.0 - :slope-up-factor 8192.0 - :slope-down-factor 8192.0 - :impact-fric 1.0 - :bend-speed 4.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - ) - ) - ) +(let ((v1-49 (new 'static + 'surface + :name '*tread-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 122880.0 + :seek90 245760.0 + :seek180 409600.0 + :fric 122880.0 + :nonlin-fric-dist 4096.0 + :slip-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 8192.0 + :impact-fric 1.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0))) ;; og:preserve-this (define *tread-surface* v1-49) (set! (-> v1-49 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-49 touch-hook) nothing) - (set! (-> v1-49 active-hook) nothing) - ) + (set! (-> v1-49 active-hook) nothing)) (define *standard-ground-surface* *stone-surface*) diff --git a/goal_src/jak1/engine/common-obs/babak.gc b/goal_src/jak1/engine/common-obs/babak.gc index 8b6e332b40..c2a86e7893 100644 --- a/goal_src/jak1/engine/common-obs/babak.gc +++ b/goal_src/jak1/engine/common-obs/babak.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "GAME.CGO") - (require "engine/common-obs/nav-enemy.gc") ;; name: babak.gc @@ -10,241 +9,197 @@ ;; DECOMP BEGINS -(deftype babak (nav-enemy) - () +(deftype babak (nav-enemy) () (:states - babak-run-to-cannon - ) - ) + babak-run-to-cannon)) - -(defskelgroup *babak-sg* babak babak-lod0-jg -1 +(defskelgroup *babak-sg* + babak + babak-lod0-jg + -1 ((babak-lod0-mg (meters 20)) (babak-lod1-mg (meters 40)) (babak-lod2-mg (meters 999999))) - :bounds (static-spherem 0 2 0 3) + :bounds + (static-spherem 0 2 0 3) :longest-edge (meters 1) - :shadow babak-shadow-mg - ) + :shadow + babak-shadow-mg) (defstate nav-enemy-patrol (babak) :virtual #t - :code (behavior () - (cond - ((ja-group? babak-give-up-hop-ja) - (ja-channel-push! 1 (seconds 0.15)) - (ja-no-eval :group! babak-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)) - ) - ) - (else - (ja-channel-push! 1 (seconds 0.2)) - ) - ) - ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))) - ) - ) + :code + (behavior () + (cond + ((ja-group? babak-give-up-hop-ja) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! babak-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) + (else (ja-channel-push! 1 (seconds 0.2)))) + ((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code))))) (defstate nav-enemy-chase (babak) :virtual #t - :code (behavior () - (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (cond - ((ja-group? babak-jump-land-ja) - (ja-no-eval :num! (seek!)) - (ja-channel-push! 1 (seconds 0.17)) - (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) - :num! (seek! max f30-0) - :frame-num 0.0 - ) - (until (ja-done? 0) - (ja-blend-eval) - (suspend) - (ja :num! (seek! max f30-0)) - ) - ) - (else - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) - (ja :num-func num-func-identity :frame-num 0.0) - ) - ) - (loop - (suspend) - (ja :num! (loop! f30-0)) - ) - ) - ) - ) + :code + (behavior () + (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) + (cond + ((ja-group? babak-jump-land-ja) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.17)) + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)))) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0))) + (loop (suspend) + (ja :num! (loop! f30-0)))))) (defstate nav-enemy-stare (babak) :virtual #t - :code (behavior () - (set! (-> self turn-time) (seconds 0.2)) - (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) - (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - ) - (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) - ) - ) - (loop - (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (ja-no-eval :num! (loop!)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! babak-turn-ja) - (ja :num-func num-func-identity :frame-num 0.0) - (until (nav-enemy-facing-player? 1820.4445) - (ja-blend-eval) - (suspend) - (ja :num! (loop! 0.75)) - ) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - ) - (if (not (ja-group? babak-idle-ja)) - (ja-channel-push! 1 (seconds 0.2)) - ) - (ja-no-eval :group! babak-idle-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0)) - ) - (when (nav-enemy-rnd-percent? 0.3) + :code + (behavior () + (set! (-> self turn-time) (seconds 0.2)) + (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) + (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek! (ja-aframe 68.0 0) f30-0)) - ) - ) - ) - ) - ) - ) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)))) + (loop (when (not (nav-enemy-facing-player? 2730.6667)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! babak-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (nav-enemy-facing-player? 1820.4445) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) + (if (not (ja-group? babak-idle-ja)) (ja-channel-push! 1 (seconds 0.2))) + (ja-no-eval :group! babak-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0))) + (when (nav-enemy-rnd-percent? 0.3) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! babak-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 68.0 0) f30-0)))))))) (defstate nav-enemy-give-up (babak) :virtual #t - :code (behavior () - (set! (-> self rotate-speed) 218453.33) - (set! (-> self turn-time) (seconds 0.5)) - (ja-channel-push! 1 (seconds 0.15)) - (let ((s4-0 (-> self collide-info)) - (s5-0 (target-pos 0)) - ) - (when (< (fabs - (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) - ) - 12743.111 - ) - (ja-no-eval :group! babak-give-up-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)) - ) - ) - ) - (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) - (nav-enemy-get-new-patrol-point) - (ja-no-eval :group! babak-give-up-hop-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (seek-to-point-toward-point! - (-> self collide-info) - (-> self nav destination-pos) - (-> self rotate-speed) - (-> self turn-time) - ) - (suspend) - (ja :num! (seek!)) - ) - (go-virtual nav-enemy-patrol) - ) - ) + :code + (behavior () + (set! (-> self rotate-speed) 218453.33) + (set! (-> self turn-time) (seconds 0.5)) + (ja-channel-push! 1 (seconds 0.15)) + (let ((s4-0 (-> self collide-info)) + (s5-0 (target-pos 0))) + (when (< (fabs (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans))))) + 12743.111) + (ja-no-eval :group! babak-give-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) + (nav-enemy-get-new-patrol-point) + (ja-no-eval :group! babak-give-up-hop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! (-> self collide-info) + (-> self nav destination-pos) + (-> self rotate-speed) + (-> self turn-time)) + (suspend) + (ja :num! (seek!))) + (go-virtual nav-enemy-patrol))) (defstate nav-enemy-jump-land (babak) :virtual #t - :code (behavior () - (ja-no-eval :num! (seek!)) - (ja-channel-push! 1 (seconds 0.075)) - (ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim)) - :num! (seek! (ja-aframe 32.0 0) 0.5) - :frame-num 0.0 - ) - (until (ja-done? 0) - (ja-blend-eval) - (suspend) - (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) - ) - (go-virtual nav-enemy-chase) - ) - ) + :code + (behavior () + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! + (-> self draw art-group data (-> self nav-info jump-land-anim)) + :num! + (seek! (ja-aframe 32.0 0) 0.5) + :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5))) + (go-virtual nav-enemy-chase))) -(define *babak-nav-enemy-info* (new 'static 'nav-enemy-info - :idle-anim 5 - :walk-anim 6 - :turn-anim 16 - :notice-anim 7 - :run-anim 8 - :jump-anim 13 - :jump-land-anim 14 - :victory-anim 11 - :taunt-anim 11 - :die-anim 12 - :neck-joint 5 - :player-look-at-joint 5 - :run-travel-speed (meters 6) - :run-rotate-speed (degrees 2880) - :run-acceleration (meters 1) - :run-turn-time (seconds 0.1) - :walk-travel-speed (meters 3) - :walk-rotate-speed (degrees 720) - :walk-acceleration (meters 1) - :walk-turn-time (seconds 0.5) - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :shadow-size (meters 2) - :notice-nav-radius (meters 2) - :nav-nearest-y-threshold (meters 10) - :notice-distance (meters 30) - :proximity-notice-distance (meters 20) - :stop-chase-distance (meters 40) - :frustration-distance (meters 8) - :frustration-time (seconds 4) - :die-anim-hold-frame 24.0 - :jump-anim-start-frame 10.0 - :jump-land-anim-end-frame 10000000000.0 - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :jump-start-anim-speed 1.0 - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :use-align #t - :draw-shadow #t - :move-to-ground #t - :hover-if-no-ground #f - :use-momentum #f - :use-flee #t - :use-proximity-notice #t - :use-jump-blocked #t - :use-jump-patrol #f - :gnd-collide-with (collide-kind background) - :debug-draw-neck #f - :debug-draw-jump #f - ) - ) +(define *babak-nav-enemy-info* + (new 'static + 'nav-enemy-info + :idle-anim 5 + :walk-anim 6 + :turn-anim 16 + :notice-anim 7 + :run-anim 8 + :jump-anim 13 + :jump-land-anim 14 + :victory-anim 11 + :taunt-anim 11 + :die-anim 12 + :neck-joint 5 + :player-look-at-joint 5 + :run-travel-speed (meters 6) + :run-rotate-speed (degrees 2880) + :run-acceleration (meters 1) + :run-turn-time (seconds 0.1) + :walk-travel-speed (meters 3) + :walk-rotate-speed (degrees 720) + :walk-acceleration (meters 1) + :walk-turn-time (seconds 0.5) + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :shadow-size (meters 2) + :notice-nav-radius (meters 2) + :nav-nearest-y-threshold (meters 10) + :notice-distance (meters 30) + :proximity-notice-distance (meters 20) + :stop-chase-distance (meters 40) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :die-anim-hold-frame 24.0 + :jump-anim-start-frame 10.0 + :jump-land-anim-end-frame 10000000000.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :jump-start-anim-speed 1.0 + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :use-align #t + :draw-shadow #t + :move-to-ground #t + :hover-if-no-ground #f + :use-momentum #f + :use-flee #t + :use-proximity-notice #t + :use-jump-blocked #t + :use-jump-patrol #f + :gnd-collide-with + (collide-kind background) + :debug-draw-neck #f + :debug-draw-jump #f)) (defmethod initialize-collision ((this babak)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -257,58 +212,43 @@ (set! (-> s3-0 prim-core action) (collide-action solid)) (set! (-> s3-0 prim-core offense) (collide-offense touch)) (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 3072.0) - (append-prim s4-0 s3-0) - ) + (append-prim s4-0 s3-0)) (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3)))) (set! (-> s3-1 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-1 collide-with) (collide-kind target)) (set! (-> s3-1 prim-core action) (collide-action solid)) (set! (-> s3-1 prim-core offense) (collide-offense touch)) (set-vector! (-> s3-1 local-sphere) 0.0 9830.4 0.0 3072.0) - (append-prim s4-0 s3-1) - ) + (append-prim s4-0 s3-1)) (let ((s3-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) (set! (-> s3-2 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-2 collide-with) (collide-kind target)) (set! (-> s3-2 prim-core offense) (collide-offense normal-attack)) (set! (-> s3-2 transform-index) 6) (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 2048.0) - (append-prim s4-0 s3-2) - ) - ) + (append-prim s4-0 s3-2))) (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> this collide-info) s5-0) - ) + (set! (-> this collide-info) s5-0)) 0 - (none) - ) + (none)) (defmethod nav-enemy-method-48 ((this babak)) - (initialize-skeleton this *babak-sg* '()) + (initialize-skeleton this *babak-sg* ()) (init-defaults! this *babak-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) (set! (-> this neck nose) (the-as uint 1)) (set! (-> this neck ear) (the-as uint 2)) 0 - (none) - ) + (none)) (defmethod nav-enemy-method-59 ((this babak)) (cond ((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) - (logtest? (-> this enemy-info options) (fact-options has-power-cell)) - ) - (go (method-of-object this nav-enemy-fuel-cell)) - ) - ((logtest? (-> this enemy-info options) (fact-options fop5)) - (go (method-of-object this nav-enemy-wait-for-cue)) - ) - (else - (go (method-of-object this nav-enemy-idle)) - ) - ) + (logtest? (-> this enemy-info options) (fact-options has-power-cell))) + (go (method-of-object this nav-enemy-fuel-cell))) + ((logtest? (-> this enemy-info options) (fact-options fop5)) (go (method-of-object this nav-enemy-wait-for-cue))) + (else (go (method-of-object this nav-enemy-idle)))) 0 - (none) - ) + (none)) diff --git a/goal_src/jak1/engine/common-obs/basebutton.gc b/goal_src/jak1/engine/common-obs/basebutton.gc index d5e673ed6e..86ee4f61e0 100644 --- a/goal_src/jak1/engine/common-obs/basebutton.gc +++ b/goal_src/jak1/engine/common-obs/basebutton.gc @@ -1,284 +1,199 @@ ;;-*-Lisp-*- + (in-package goal) (bundles "GAME.CGO") - (require "engine/common-obs/generic-obs.gc") (require "engine/target/logic-target.gc") ;; name: basebutton.gc -;; name in dgo: basebutton -;; dgos: GAME, COMMON, L1 +;; name in dgo: basebutton + +;; dgos: GAME, COMMON, L1 ;; DECOMP BEGINS (deftype basebutton (process-drawable) - ((root collide-shape-moving :override) - (down? symbol) - (spawned-by-other? symbol) - (move-to? symbol) - (notify-actor entity-actor) - (timeout float) - (button-id int32) - (event-going-down symbol) - (event-down symbol) - (event-going-up symbol) - (event-up symbol) - (anim-speed float) - (move-to-pos vector :inline) - (move-to-quat quaternion :inline) - ) + ((root collide-shape-moving :override) + (down? symbol) + (spawned-by-other? symbol) + (move-to? symbol) + (notify-actor entity-actor) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline)) (:state-methods - basebutton-down-idle - basebutton-going-down - basebutton-going-up - basebutton-startup - basebutton-up-idle - ) + basebutton-down-idle + basebutton-going-down + basebutton-going-up + basebutton-startup + basebutton-up-idle) (:methods - (reset! (_type_) float) - (basebutton-method-26 (_type_) none) - (basebutton-method-27 (_type_) collide-shape-moving) - (arm-trigger-event! (_type_) symbol) - (basebutton-method-29 (_type_ symbol entity) none) - (move-to-vec-or-quat! (_type_ vector quaternion) quaternion) - (press! (_type_ symbol) int) - ) - ) + (reset! (_type_) float) + (basebutton-method-26 (_type_) none) + (basebutton-method-27 (_type_) collide-shape-moving) + (arm-trigger-event! (_type_) symbol) + (basebutton-method-29 (_type_ symbol entity) none) + (move-to-vec-or-quat! (_type_ vector quaternion) quaternion) + (press! (_type_ symbol) int))) - -(defskelgroup *generic-button-sg* generic-button generic-button-lod0-jg generic-button-idle-ja - ((generic-button-lod0-mg (meters 999999))) - :bounds (static-spherem 0 0 0 3) - ) +(defskelgroup *generic-button-sg* + generic-button + generic-button-lod0-jg + generic-button-idle-ja + ((generic-button-lod0-mg (meters 999999))) + :bounds + (static-spherem 0 0 0 3)) (defmethod move-to-vec-or-quat! ((this basebutton) (arg0 vector) (arg1 quaternion)) (set! (-> this move-to?) #t) - (if arg0 - (set! (-> this move-to-pos quad) (-> arg0 quad)) - (set! (-> this move-to-pos quad) (-> this root trans quad)) - ) - (if arg1 - (quaternion-copy! (-> this move-to-quat) arg1) - (quaternion-copy! (-> this move-to-quat) (-> this root quat)) - ) - ) + (if arg0 (set! (-> this move-to-pos quad) (-> arg0 quad)) (set! (-> this move-to-pos quad) (-> this root trans quad))) + (if arg1 (quaternion-copy! (-> this move-to-quat) arg1) (quaternion-copy! (-> this move-to-quat) (-> this root quat)))) (defstate basebutton-startup (basebutton) :virtual #t - :code (behavior () - (if (-> self down?) - (go-virtual basebutton-down-idle) - (go-virtual basebutton-up-idle) - ) - ) - ) + :code + (behavior () + (if (-> self down?) (go-virtual basebutton-down-idle) (go-virtual basebutton-up-idle)))) (defstate basebutton-up-idle (basebutton) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('attack) - (case (-> block param 1) - (('flop) - (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) - (sound-play "silo-button") - (go-virtual basebutton-going-down) - ) - ) - ) - (('trigger) - (sound-play "silo-button") - (go-virtual basebutton-going-down) - ) - (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) - ) - ) - ) - :enter (behavior () - (press! self #f) - ) - :trans (behavior () - (if (-> self move-to?) - (rider-trans) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (case (-> block param 1) + (('flop) + (basebutton-method-29 self (-> self event-going-down) (-> self notify-actor)) + (sound-play "silo-button") + (go-virtual basebutton-going-down)))) + (('trigger) (sound-play "silo-button") (go-virtual basebutton-going-down)) + (('move-to) (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))))) + :enter + (behavior () + (press! self #f)) + :trans + (behavior () + (if (-> self move-to?) (rider-trans))) :code anim-loop - :post (behavior () - (when (-> self move-to?) - (set! (-> self move-to?) #f) - (set! (-> self root trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root quat) (-> self move-to-quat)) - (rider-post) - ) - ) - ) + :post + (behavior () + (when (-> self move-to?) + (set! (-> self move-to?) #f) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post)))) (defstate basebutton-going-down (basebutton) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('untrigger) - (sound-play "silo-button") - (go-virtual basebutton-going-up) - ) - (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) - ) - ) - ) - :enter (behavior () - (press! self #t) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up)) + (('move-to) (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))))) + :enter + (behavior () + (press! self #t)) :trans rider-trans - :code (behavior () - (ja-no-eval :num! (seek! max (-> self anim-speed))) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max (-> self anim-speed))) - ) - (basebutton-method-29 self (-> self event-down) (-> self notify-actor)) - (go-virtual basebutton-down-idle) - ) - :post (behavior () - (when (-> self move-to?) - (set! (-> self move-to?) #f) - (set! (-> self root trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root quat) (-> self move-to-quat)) - ) - (rider-post) - ) - ) + :code + (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed)))) + (basebutton-method-29 self (-> self event-down) (-> self notify-actor)) + (go-virtual basebutton-down-idle)) + :post + (behavior () + (when (-> self move-to?) + (set! (-> self move-to?) #f) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat))) + (rider-post))) (defstate basebutton-down-idle (basebutton) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('untrigger) - (sound-play "silo-button") - (go-virtual basebutton-going-up) - ) - (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) - ) - ) - ) - :enter (behavior () - (press! self #t) - ) - :trans (behavior () - (if (-> self move-to?) - (rider-trans) - ) - ) - :code (behavior () - (set-time! (-> self state-time)) - (cond - ((= (-> self timeout) 0.0) - (anim-loop) - ) - (else - (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) - (suspend) - ) - (basebutton-method-29 self (-> self event-going-up) (-> self notify-actor)) - (sound-play "silo-button") - (go-virtual basebutton-going-up) - ) - ) - ) - :post (behavior () - (when (-> self move-to?) - (set! (-> self move-to?) #f) - (set! (-> self root trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root quat) (-> self move-to-quat)) - (rider-post) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) (sound-play "silo-button") (go-virtual basebutton-going-up)) + (('move-to) (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))))) + :enter + (behavior () + (press! self #t)) + :trans + (behavior () + (if (-> self move-to?) (rider-trans))) + :code + (behavior () + (set-time! (-> self state-time)) + (cond + ((= (-> self timeout) 0.0) (anim-loop)) + (else + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) + (suspend)) + (basebutton-method-29 self (-> self event-going-up) (-> self notify-actor)) + (sound-play "silo-button") + (go-virtual basebutton-going-up)))) + :post + (behavior () + (when (-> self move-to?) + (set! (-> self move-to?) #f) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post)))) (defstate basebutton-going-up (basebutton) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('move-to) - (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) - ) - (('trigger) - (sound-play "silo-button") - (go-virtual basebutton-going-down) - ) - ) - ) - :enter (behavior () - (press! self #f) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) (move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))) + (('trigger) (sound-play "silo-button") (go-virtual basebutton-going-down)))) + :enter + (behavior () + (press! self #f)) :trans rider-trans - :code (behavior () - (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! 0.0 (-> self anim-speed))) - ) - (basebutton-method-29 self (-> self event-up) (-> self notify-actor)) - (go-virtual basebutton-up-idle) - ) - :post (behavior () - (when (-> self move-to?) - (set! (-> self move-to?) #f) - (set! (-> self root trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root quat) (-> self move-to-quat)) - ) - (rider-post) - ) - ) + :code + (behavior () + (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0 (-> self anim-speed)))) + (basebutton-method-29 self (-> self event-up) (-> self notify-actor)) + (go-virtual basebutton-up-idle)) + :post + (behavior () + (when (-> self move-to?) + (set! (-> self move-to?) #f) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat))) + (rider-post))) (defmethod press! ((this basebutton) (arg0 symbol)) (set! (-> this down?) arg0) (cond - (arg0 - (if (not (-> this spawned-by-other?)) - (process-entity-status! this (entity-perm-status complete) #t) - ) - ) - (else - (if (not (-> this spawned-by-other?)) - (process-entity-status! this (entity-perm-status complete) #f) - ) - ) - ) - ) + (arg0 (if (not (-> this spawned-by-other?)) (process-entity-status! this (entity-perm-status complete) #t))) + (else (if (not (-> this spawned-by-other?)) (process-entity-status! this (entity-perm-status complete) #f))))) (defmethod basebutton-method-29 ((this basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 (cond (arg1 - (let ((v1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-0 from) pp) - (set! (-> v1-0 num-params) 0) - (set! (-> v1-0 message) arg0) - (let ((a1-1 arg1)) - (send-event-function - (if a1-1 - (-> a1-1 extra process) - ) - v1-0 - ) - ) - ) - ) - (else - (if (nonzero? (-> this link)) - (send-to-all (-> this link) arg0) - ) - ) - ) - ) - (none) - ) - ) + (let ((v1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-0 from) pp) + (set! (-> v1-0 num-params) 0) + (set! (-> v1-0 message) arg0) + (let ((a1-1 arg1)) (send-event-function (if a1-1 (-> a1-1 extra process)) v1-0)))) + (else (if (nonzero? (-> this link)) (send-to-all (-> this link) arg0))))) + (none))) (defmethod reset! ((this basebutton)) (set! (-> this down?) #f) @@ -290,57 +205,34 @@ (set! (-> this event-down) #f) (set! (-> this event-going-up) #f) (set! (-> this event-up) #f) - (set! (-> this anim-speed) 1.0) - ) + (set! (-> this anim-speed) 1.0)) (defmethod arm-trigger-event! ((this basebutton)) - (let ((v0-0 'trigger)) - (set! (-> this event-going-down) v0-0) - v0-0 - ) - ) + (let ((v0-0 'trigger)) (set! (-> this event-going-down) v0-0) v0-0)) (defmethod basebutton-method-26 ((this basebutton)) - (initialize-skeleton this *generic-button-sg* '()) + (initialize-skeleton this *generic-button-sg* ()) (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond ((-> this down?) (let ((s5-0 (-> this skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> this draw art-group data 2)) - num-func-identity - ) - (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) - ) - ) - ) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + (set! (-> s5-0 frame-num) (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1))))) (else - (let ((s5-1 (-> this skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> this draw art-group data 2)) - num-func-identity - ) - (set! (-> s5-1 frame-num) 0.0) - ) - ) - ) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + (set! (-> s5-1 frame-num) 0.0)))) (set! (-> this anim-speed) 2.0) (update-transforms! (-> this root)) (ja-post) - (none) - ) + (none)) (defmethod basebutton-method-27 ((this basebutton)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (alloc-riders s5-0 1) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -355,8 +247,7 @@ (set! (-> s3-0 prim-core offense) (collide-offense indestructible)) (set! (-> s3-0 transform-index) 4) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 12288.0) - (append-prim s4-0 s3-0) - ) + (append-prim s4-0 s3-0)) (let ((s3-1 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) (set! (-> s3-1 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-1 collide-with) (collide-kind target)) @@ -364,49 +255,33 @@ (set! (-> s3-1 prim-core offense) (collide-offense indestructible)) (set! (-> s3-1 transform-index) 3) (set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 12288.0) - (append-prim s4-0 s3-1) - ) - ) + (append-prim s4-0 s3-1))) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) (set! (-> this root) s5-0) - s5-0 - ) - ) + s5-0)) (defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) (reset! this) (set! (-> this spawned-by-other?) #f) (set! (-> this button-id) -1) (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1)))) - (if (>= (the-as int v1-4) 0) - (set! (-> this button-id) (the-as int v1-4)) - ) - ) + (if (>= (the-as int v1-4) 0) (set! (-> this button-id) (the-as int v1-4)))) (when (or (res-lump-struct arg0 'next-actor structure) (res-lump-struct arg0 'prev-actor structure)) (set! (-> this link) (new 'process 'actor-link-info this)) - (if (< (-> this button-id) 0) - (set! (-> this button-id) (actor-count-before (-> this link))) - ) - ) + (if (< (-> this button-id) 0) (set! (-> this button-id) (actor-count-before (-> this link))))) (basebutton-method-27 this) (process-drawable-from-entity! this arg0) (let ((v1-16 #f)) - (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) - (set! v1-16 #t) - ) - (set! (-> this down?) v1-16) - ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! v1-16 #t)) + (set! (-> this down?) v1-16)) (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this timeout) (res-lump-float arg0 'timeout)) - (if (not (-> this spawned-by-other?)) - (nav-mesh-connect this (-> this root) (the-as nav-control #f)) - ) + (if (not (-> this spawned-by-other?)) (nav-mesh-connect this (-> this root) (the-as nav-control #f))) (arm-trigger-event! this) (basebutton-method-26 this) (go (method-of-object this basebutton-startup)) - (none) - ) + (none)) (defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) (reset! self) @@ -415,9 +290,7 @@ (set! (-> self down?) arg4) (set! (-> self notify-actor) arg3) (set! (-> self timeout) arg5) - (if arg0 - (set! (-> self entity) arg0) - ) + (if arg0 (set! (-> self entity) arg0)) (basebutton-method-27 self) (set! (-> self root trans quad) (-> arg1 quad)) (quaternion-copy! (-> self root quat) arg2) @@ -425,228 +298,167 @@ (arm-trigger-event! self) (basebutton-method-26 self) (go-virtual basebutton-startup) - (none) - ) + (none)) -(define *warp-info* (new 'static 'boxed-array :type string - "training-warp" - "village1-warp" - "village2-warp" - "village3-warp" - "citadel-warp" - ) - ) +(define *warp-info* + (new 'static 'boxed-array :type string "training-warp" "village1-warp" "village2-warp" "village3-warp" "citadel-warp")) (deftype warp-gate (process-drawable) - ((level symbol) - (level-slot int32) - (min-slot int32) - (max-slot int32) - ) + ((level symbol) + (level-slot int32) + (min-slot int32) + (max-slot int32)) (:state-methods - idle - active - (use int level) - hidden - ) - ) - + idle + active + (use int level) + hidden)) (defstate use (warp-gate) :virtual #t - :trans (behavior () - (send-event *camera* 'joystick 0.0 0.0) - ) - :code (behavior ((arg0 int) (arg1 level)) - (set-time! (-> self state-time)) - (when (not arg1) - (process-release? *target*) - (go-virtual idle) - ) - (let ((s4-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> s4-0 from) self) - (set! (-> s4-0 num-params) 3) - (set! (-> s4-0 message) 'change-state) - (set! (-> s4-0 param 0) (the-as uint target-warp-out)) - (let ((v1-9 (new 'static 'vector))) - (set! (-> v1-9 quad) (-> self root trans quad)) - (set! (-> s4-0 param 1) (the-as uint v1-9)) - ) - (set! (-> s4-0 param 2) (the-as uint (target-pos 0))) - (send-event-function *target* s4-0) - ) - ;; og:preserve-this - ;; NOTE : added case for "training" here. in the original game, the training level does NOT come - ;; with its own code for warp gates and buttons, and uses the villagep-obs imported from village1 - ;; instead. opengoal loads files different enough that warp from training to anywhere except village1 - ;; crashes the game due to running unlinked code. the original game also crashes, but it is not consistent. - ;; the citadel/lavatube case makes it so we wait until it's safe to unload both levels in the heaps, - ;; since the citadel warp gate is located in both levels at once (visually lavatube, technically citadel) - ;; we add "training" to the list here so that the training warp gate waits until it's safe to - ;; dispose the old code from memory. - (case (-> self level) - (('citadel 'lavatube 'training) - (while (and *target* (not (logtest? (-> *target* draw status) (draw-status hidden)))) - (suspend) - ) - ) - (else - (load-state-want-levels (-> self level) (-> arg1 load-name)) - (while (or (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) - (not (time-elapsed? (-> self state-time) (seconds 2))) - ) - (suspend) - ) - ) - ) - (set-blackout-frames (seconds 0.05)) - (start 'play (get-continue-by-name *game-info* (-> *warp-info* arg0))) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - 0 - ) - ) + :trans + (behavior () + (send-event *camera* 'joystick 0.0 0.0)) + :code + (behavior ((arg0 int) (arg1 level)) + (set-time! (-> self state-time)) + (when (not arg1) + (process-release? *target*) + (go-virtual idle)) + (let ((s4-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-0 from) self) + (set! (-> s4-0 num-params) 3) + (set! (-> s4-0 message) 'change-state) + (set! (-> s4-0 param 0) (the-as uint target-warp-out)) + (let ((v1-9 (new 'static 'vector))) + (set! (-> v1-9 quad) (-> self root trans quad)) + (set! (-> s4-0 param 1) (the-as uint v1-9))) + (set! (-> s4-0 param 2) (the-as uint (target-pos 0))) + (send-event-function *target* s4-0)) + ;; og:preserve-this + ;; NOTE : added case for "training" here. in the original game, the training level does NOT come + ;; with its own code for warp gates and buttons, and uses the villagep-obs imported from village1 + ;; instead. opengoal loads files different enough that warp from training to anywhere except village1 + ;; crashes the game due to running unlinked code. the original game also crashes, but it is not consistent. + ;; the citadel/lavatube case makes it so we wait until it's safe to unload both levels in the heaps, + ;; since the citadel warp gate is located in both levels at once (visually lavatube, technically citadel) + ;; we add "training" to the list here so that the training warp gate waits until it's safe to + ;; dispose the old code from memory. + (case (-> self level) + (('citadel 'lavatube 'training) + (while (and *target* (not (logtest? (-> *target* draw status) (draw-status hidden)))) + (suspend))) + (else + (load-state-want-levels (-> self level) (-> arg1 load-name)) + (while (or (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) + (not (time-elapsed? (-> self state-time) (seconds 2)))) + (suspend)))) + (set-blackout-frames (seconds 0.05)) + (start 'play (get-continue-by-name *game-info* (-> *warp-info* arg0))) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0)) -(define *warp-jump-mods* (new 'static 'surface - :name 'jump - :turnv 273066.66 - :turnvv 1820444.5 - :tiltv 32768.0 - :tiltvv 131072.0 - :transv-max 65536.0 - :target-speed 65536.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :mode 'air - :flags (surface-flags always-rotate-toward-transv) - ) - ) +(define *warp-jump-mods* + (new 'static + 'surface + :name 'jump + :turnv 273066.66 + :turnvv 1820444.5 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 65536.0 + :target-speed 65536.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags (surface-flags always-rotate-toward-transv))) (defstate target-warp-out (target) - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('death-end) - (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) - (set! (-> self draw status) (the-as draw-status v0-0)) - v0-0 - ) - ) - (else - (target-generic-event-handler proc argc message block) - ) - ) - ) - :enter (behavior ((arg0 vector) (arg1 vector)) - (set-time! (-> self state-time)) - (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! (-> self control unknown-surface00) *warp-jump-mods*) - (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) - (set! (-> self control unknown-vector103 quad) (-> arg1 quad)) - (+! (-> self control unknown-vector102 y) -4096.0) - (set! (-> self control unknown-uint20) (the-as uint #f)) - (vector-reset! (-> self control transv)) - (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) - (set! (-> self alt-cam-pos quad) (-> arg1 quad)) - ) - :exit (behavior () - (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) - ) - :code (behavior ((arg0 vector) (arg1 vector)) - (send-event *camera* 'change-state cam-fixed 0) - (ja-channel-push! 1 (seconds 0.2)) - (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 16.0 0))) - ) - (vector-! (-> self control transv) (-> self control unknown-vector102) (-> self control trans)) - (vector-xz-normalize! (-> self control transv) 32768.0) - (let ((gp-2 (new-stack-vector0))) - (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - 0.0 - (vector-! gp-2 (-> self control transv) (vector-float*! gp-2 (-> self control dynam gravity-normal) f0-6)) - ) - (let* ((f0-7 (vector-length gp-2)) - (f1-1 f0-7) - (f2-4 - (- (sqrtf - (* 2.0 - (-> self control dynam gravity-length) - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector102) (-> self control trans)) - ) - ) - ) - (* 0.008333334 (- (-> self control dynam gravity-length))) - ) - ) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4) - (vector-float*! gp-2 gp-2 (/ f0-7 f1-1)) - ) - ) - ) - (clear-collide-with-as (-> self control)) - (set-time! (-> self state-time)) - (set! (-> self trans-hook) - (lambda :behavior target - () - (let ((gp-0 (new-stack-vector0)) - (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - ) - 0.0 - (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) - (let* ((f0-3 (vector-length gp-0)) - (f1-0 f0-3) - ) - (if (< f30-0 0.0) - (set! f30-0 8192.0) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) - (vector-float*! gp-0 gp-0 (/ f0-3 f1-0)) - ) - ) - ) - (let ((gp-2 (vector-! (new-stack-vector0) (-> self control unknown-vector102) (-> self control trans)))) - (set! (-> gp-2 y) 0.0) - (send-event *target* 'sidekick #f) - (when (and (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) - (time-elapsed? (-> self state-time) (seconds 0.05)) - ) - (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) - (set! (-> self control transv x) (* 0.95 (-> self control transv x))) - (set! (-> self control transv z) (* 0.95 (-> self control transv z))) - (when (not (-> self control unknown-spoolanim00)) - (send-event self 'do-effect 'death-warp-out -1.0) - (let ((v0-2 #t)) - (set! (-> self control unknown-uint20) (the-as uint v0-2)) - v0-2 - ) - ) - ) - ) - ) - ) - (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 40.0 0)) :frame-num (ja-aframe 16.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 40.0 0))) - ) - (anim-loop) - ) - :post target-no-stick-post - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('death-end) + (let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden))))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0)) + (else (target-generic-event-handler proc argc message block)))) + :enter + (behavior ((arg0 vector) (arg1 vector)) + (set-time! (-> self state-time)) + (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) + (set! (-> self control unknown-surface00) *warp-jump-mods*) + (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) + (set! (-> self control unknown-vector103 quad) (-> arg1 quad)) + (+! (-> self control unknown-vector102 y) -4096.0) + (set! (-> self control unknown-uint20) (the-as uint #f)) + (vector-reset! (-> self control transv)) + (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) + (set! (-> self alt-cam-pos quad) (-> arg1 quad))) + :exit + (behavior () + (logclear! (-> self state-flags) (state-flags use-alt-cam-pos))) + :code + (behavior ((arg0 vector) (arg1 vector)) + (send-event *camera* 'change-state cam-fixed 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0)))) + (vector-! (-> self control transv) (-> self control unknown-vector102) (-> self control trans)) + (vector-xz-normalize! (-> self control transv) 32768.0) + (let ((gp-2 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-2 (-> self control transv) (vector-float*! gp-2 (-> self control dynam gravity-normal) f0-6))) + (let* ((f0-7 (vector-length gp-2)) + (f1-1 f0-7) + (f2-4 (- (sqrtf (* 2.0 + (-> self control dynam gravity-length) + (vector-dot (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector102) (-> self control trans))))) + (* 0.008333334 (- (-> self control dynam gravity-length)))))) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4) + (vector-float*! gp-2 gp-2 (/ f0-7 f1-1))))) + (clear-collide-with-as (-> self control)) + (set-time! (-> self state-time)) + (set! (-> self trans-hook) + (lambda :behavior target () + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f0-3 (vector-length gp-0)) + (f1-0 f0-3)) + (if (< f30-0 0.0) (set! f30-0 8192.0)) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) + (vector-float*! gp-0 gp-0 (/ f0-3 f1-0))))) + (let ((gp-2 (vector-! (new-stack-vector0) (-> self control unknown-vector102) (-> self control trans)))) + (set! (-> gp-2 y) 0.0) + (send-event *target* 'sidekick #f) + (when (and (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) + (time-elapsed? (-> self state-time) (seconds 0.05))) + (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) + (set! (-> self control transv x) (* 0.95 (-> self control transv x))) + (set! (-> self control transv z) (* 0.95 (-> self control transv z))) + (when (not (-> self control unknown-spoolanim00)) + (send-event self 'do-effect 'death-warp-out -1.0) + (let ((v0-2 #t)) (set! (-> self control unknown-uint20) (the-as uint v0-2)) v0-2)))))) + (ja-no-eval :group! eichar-duck-high-jump-ja :num! (seek! (ja-aframe 40.0 0)) :frame-num (ja-aframe 16.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 40.0 0)))) + (anim-loop)) + :post target-no-stick-post) diff --git a/goal_src/jak1/engine/common-obs/baseplat.gc b/goal_src/jak1/engine/common-obs/baseplat.gc index 80a08799e2..9ceec67225 100644 --- a/goal_src/jak1/engine/common-obs/baseplat.gc +++ b/goal_src/jak1/engine/common-obs/baseplat.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "GAME.CGO") - (require "engine/common-obs/generic-obs.gc") (require "engine/game/projectiles.gc") @@ -43,36 +42,30 @@ (ecdf28) (ecdf29) (ecdf30) - (ecdf31) - ) + (ecdf31)) ;; DECOMP BEGINS (deftype baseplat (process-drawable) - ((root collide-shape-moving :override) - (smush smush-control :inline) - (basetrans vector :inline) - (bouncing symbol) - ) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (basetrans vector :inline) + (bouncing symbol)) (:methods - (baseplat-method-20 (_type_) none) - (baseplat-method-21 (_type_) none) - (baseplat-method-22 (_type_) none) - (get-unlit-skel (_type_) skeleton-group) - (baseplat-method-24 (_type_) none) - (baseplat-method-25 (_type_) sparticle-launch-group) - (baseplat-method-26 (_type_) none) - ) - ) - + (baseplat-method-20 (_type_) none) + (baseplat-method-21 (_type_) none) + (baseplat-method-22 (_type_) none) + (get-unlit-skel (_type_) skeleton-group) + (baseplat-method-24 (_type_) none) + (baseplat-method-25 (_type_) sparticle-launch-group) + (baseplat-method-26 (_type_) none))) (defmethod baseplat-method-21 ((this baseplat)) (logior! (-> this skel status) (janim-status inited)) (set! (-> this basetrans quad) (-> this root trans quad)) (set! (-> this bouncing) #f) 0 - (none) - ) + (none)) (defmethod baseplat-method-22 ((this baseplat)) (activate! (-> this smush) -1.0 60 150 1.0 1.0) @@ -80,26 +73,20 @@ (logclear! (-> this mask) (process-mask sleep)) (logclear! (-> this mask) (process-mask sleep-code)) 0 - (none) - ) + (none)) (defbehavior plat-code baseplat () (transform-post) (suspend) (transform-post) (suspend) - (loop - (when (not (-> self bouncing)) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - 0 - ) + (loop (when (not (-> self bouncing)) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0) (while (-> self bouncing) - (suspend) - ) - ) - (none) - ) + (suspend))) + (none)) (defbehavior plat-trans baseplat () (rider-trans) @@ -108,216 +95,145 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self basetrans quad)) (+! (-> gp-0 y) (* 819.2 (update! (-> self smush)))) - (move-to-point! (-> self root) gp-0) - ) - (if (not (!= (-> self smush amp) 0.0)) - (set! (-> self bouncing) #f) - ) - ) - (else - (move-to-point! (-> self root) (-> self basetrans)) - ) - ) - (none) - ) + (move-to-point! (-> self root) gp-0)) + (if (not (!= (-> self smush amp) 0.0)) (set! (-> self bouncing) #f))) + (else (move-to-point! (-> self root) (-> self basetrans)))) + (none)) (defbehavior plat-post baseplat () (baseplat-method-20 self) (rider-post) - (none) - ) + (none)) (defmethod baseplat-method-25 ((this baseplat)) - (the-as sparticle-launch-group 0) - ) + (the-as sparticle-launch-group 0)) (defmethod baseplat-method-20 ((this baseplat)) - (if (nonzero? (-> this part)) - (spawn (-> this part) (-> this root trans)) - ) - (none) - ) + (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans))) + (none)) (defbehavior plat-event baseplat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('bonk) - (baseplat-method-22 self) - ) - ) - ) + (('bonk) (baseplat-method-22 self)))) (deftype eco-door (process-drawable) - ((root collide-shape :override) - (speed float) - (open-distance float) - (close-distance float) - (out-dir vector :inline) - (open-sound sound-name) - (close-sound sound-name) - (state-actor entity-actor) - (flags eco-door-flags) - (locked symbol) - (auto-close symbol) - (one-way symbol) - ) + ((root collide-shape :override) + (speed float) + (open-distance float) + (close-distance float) + (out-dir vector :inline) + (open-sound sound-name) + (close-sound sound-name) + (state-actor entity-actor) + (flags eco-door-flags) + (locked symbol) + (auto-close symbol) + (one-way symbol)) (:state-methods - door-closed - door-opening - door-open - door-closing - ) + door-closed + door-opening + door-open + door-closing) (:methods - (eco-door-method-24 (_type_) none) - (eco-door-method-25 (_type_) none) - (eco-door-method-26 (_type_) none) - ) - ) - + (eco-door-method-24 (_type_) none) + (eco-door-method-25 (_type_) none) + (eco-door-method-26 (_type_) none))) (defbehavior eco-door-event-handler eco-door ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) (set! (-> self locked) (not (-> self locked))) (cond - ((-> self locked) - (if (= (-> self next-state name) 'door-closed) - (sound-play "door-lock") - ) - ) - (else - (sound-play "door-unlock") - ) - ) - #t - ) - ) - ) + ((-> self locked) (if (= (-> self next-state name) 'door-closed) (sound-play "door-lock"))) + (else (sound-play "door-unlock"))) + #t))) eco-door-event-handler (defstate door-closed (eco-door) :virtual #t :event eco-door-event-handler - :code (behavior () - (ja :num-func num-func-identity :frame-num 0.0) - (suspend) - (update-transforms! (-> self root)) - (ja-post) - (loop - (when (and *target* - (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) - (eco-door-method-26 self) - (if (and (not (-> self locked)) - (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (send-event *target* 'query 'powerup (pickup-type eco-blue)) - (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)) - ) - ) - (go-virtual door-opening) - ) - (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) - ) + :code + (behavior () + (ja :num-func num-func-identity :frame-num 0.0) (suspend) - ) - ) - ) + (update-transforms! (-> self root)) + (ja-post) + (loop (when (and *target* (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (eco-door-method-26 self) + (if (and (not (-> self locked)) + (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)))) + (go-virtual door-opening)) + (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none))) + (suspend)))) (defstate door-opening (eco-door) :virtual #t :event eco-door-event-handler - :code (behavior () - (let ((gp-0 - (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (send-event *target* 'query 'powerup (pickup-type eco-blue)) - ) - ) - ) - (if gp-0 - (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) - ) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) - (clear-collide-with-as (-> self root)) - (until (ja-done? 0) - (ja :num! (seek! max (-> self speed))) - (if (and gp-0 (rand-vu-percent? 0.5)) - (spawn-projectile-blue *target*) - ) - (suspend) - ) - ) - (go-virtual door-open) - ) - :post transform-post - ) + :code + (behavior () + (let ((gp-0 (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (send-event *target* 'query 'powerup (pickup-type eco-blue))))) + (if gp-0 (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans)))) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (clear-collide-with-as (-> self root)) + (until (ja-done? 0) + (ja :num! (seek! max (-> self speed))) + (if (and gp-0 (rand-vu-percent? 0.5)) (spawn-projectile-blue *target*)) + (suspend))) + (go-virtual door-open)) + :post transform-post) (defstate door-open (eco-door) :virtual #t :event eco-door-event-handler - :code (behavior () - (set-time! (-> self state-time)) - (process-entity-status! self (entity-perm-status complete) #t) - (clear-collide-with-as (-> self root)) - (ja :num-func num-func-identity :frame-num max) - (logior! (-> self draw status) (draw-status hidden)) - (suspend) - (update-transforms! (-> self root)) - (ja-post) - (loop - (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) - (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) - ) - (when (and (-> self auto-close) - (or (not *target*) - (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) - ) - (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) - (go-virtual door-closing) - ) - ) - ) + :code + (behavior () + (set-time! (-> self state-time)) + (process-entity-status! self (entity-perm-status complete) #t) + (clear-collide-with-as (-> self root)) + (ja :num-func num-func-identity :frame-num max) + (logior! (-> self draw status) (draw-status hidden)) (suspend) - ) - ) - ) + (update-transforms! (-> self root)) + (ja-post) + (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) + (f28-0 (vector4-dot (-> self out-dir) (camera-pos)))) + (when (and (-> self auto-close) + (or (not *target*) + (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))))) + (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) (go-virtual door-closing)))) + (suspend)))) (defstate door-closing (eco-door) :virtual #t :event eco-door-event-handler - :code (behavior () - (restore-collide-with-as (-> self root)) - (logclear! (-> self draw status) (draw-status hidden)) - (let ((gp-0 (new 'stack 'overlaps-others-params))) - (set! (-> gp-0 options) (the-as uint 1)) - (set! (-> gp-0 tlist) #f) - (while (find-overlapping-shapes (-> self root) gp-0) - (suspend) - ) - ) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) - (until (ja-done? 0) - (ja :num! (seek! 0.0 (-> self speed))) - (suspend) - ) - (if (-> self locked) - (sound-play "door-lock") - ) - (go-virtual door-closed) - ) - :post transform-post - ) + :code + (behavior () + (restore-collide-with-as (-> self root)) + (logclear! (-> self draw status) (draw-status hidden)) + (let ((gp-0 (new 'stack 'overlaps-others-params))) + (set! (-> gp-0 options) (the-as uint 1)) + (set! (-> gp-0 tlist) #f) + (while (find-overlapping-shapes (-> self root) gp-0) + (suspend))) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (until (ja-done? 0) + (ja :num! (seek! 0.0 (-> self speed))) + (suspend)) + (if (-> self locked) (sound-play "door-lock")) + (go-virtual door-closed)) + :post transform-post) (defmethod eco-door-method-26 ((this eco-door)) (when (-> this state-actor) (if (logtest? (-> this state-actor extra perm status) (entity-perm-status complete)) - (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) - (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))) - ) - ) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))))) 0 - (none) - ) + (none)) (defmethod eco-door-method-24 ((this eco-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -328,36 +244,27 @@ eco-door-event-handler (set! (-> s4-0 prim-core offense) (collide-offense indestructible)) (set! (-> s4-0 transform-index) 0) (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 16384.0) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) 0 - (none) - ) + (none)) (defmethod eco-door-method-25 ((this eco-door)) 0 - (none) - ) + (none)) (defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) (eco-door-method-24 this) (process-drawable-from-entity! this arg0) (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) - (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) - ) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0)) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) (set! (-> this speed) 1.0) (set! (-> this state-actor) #f) - (let ((v1-5 (entity-actor-lookup arg0 'state-actor 0))) - (if v1-5 - (set! (-> this state-actor) v1-5) - ) - ) + (let ((v1-5 (entity-actor-lookup arg0 'state-actor 0))) (if v1-5 (set! (-> this state-actor) v1-5))) (set! (-> this locked) #f) (set! (-> this flags) (res-lump-value arg0 'flags eco-door-flags)) (eco-door-method-26 this) @@ -369,10 +276,7 @@ eco-door-event-handler (eco-door-method-25 this) (if (and (not (-> this auto-close)) (-> this entity) - (logtest? (-> this entity extra perm status) (entity-perm-status complete)) - ) - (go (method-of-object this door-open)) - (go (method-of-object this door-closed)) - ) - (none) - ) + (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (go (method-of-object this door-open)) + (go (method-of-object this door-closed))) + (none)) diff --git a/goal_src/jak1/engine/common-obs/collectables-part.gc b/goal_src/jak1/engine/common-obs/collectables-part.gc index b1bde8eed5..84e12284b6 100644 --- a/goal_src/jak1/engine/common-obs/collectables-part.gc +++ b/goal_src/jak1/engine/common-obs/collectables-part.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/common-obs/generic-obs-h.gc") (require "engine/gfx/sprite/sparticle/sparticle-h.gc") (require "engine/anim/joint-h.gc") @@ -17,692 +16,603 @@ ;; why is this file built first.... ;; TODO - also for entity and beach-rocks (declare-type collectable process-drawable) + (declare-type eco-collectable process-drawable) ;; DECOMP BEGINS (defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (not (logtest? (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) - ) - (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) - ) + (if (not (logtest? (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles))) + (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2)))) 0 - (none) - ) + (none)) (defun eco-track-root-prim-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (let ((v1-1 (the-as process-drawable (-> arg1 key proc)))) (let ((a0-3 (-> (the-as collide-shape-moving (-> v1-1 root)) root-prim prim-core))) (set! (-> arg2 x) (-> a0-3 world-sphere x)) (set! (-> arg2 y) (-> a0-3 world-sphere y)) - (set! (-> arg2 z) (-> a0-3 world-sphere z)) - ) + (set! (-> arg2 z) (-> a0-3 world-sphere z))) (if (not (logtest? (-> v1-1 state-flags) (state-flags fade-out-particles))) - (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) - ) - ) + (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))))) 0 - (none) - ) + (none)) (defun part-tracker-track-root ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (let ((v1-3 (-> (the-as process-drawable (-> arg1 key proc)) root trans))) (set! (-> arg2 x) (-> v1-3 x)) (set! (-> arg2 y) (-> v1-3 y)) - (set! (-> arg2 z) (-> v1-3 z)) - ) + (set! (-> arg2 z) (-> v1-3 z))) 0 - (none) - ) + (none)) (defun part-tracker-move-to-target ((arg0 part-tracker)) (let* ((v1-0 *target*) - (a2-0 (if (not v1-0) - (-> arg0 root trans) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data 5)) - ) - ) - ) - (vector-lerp! - (-> arg0 root trans) - (-> arg0 offset) - a2-0 - (* 0.006666667 (the float (- (current-time) (-> arg0 start-time)))) - ) - ) - ) + (a2-0 (if (not v1-0) (-> arg0 root trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data 5))))) + (vector-lerp! (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (* 0.006666667 (the float (- (current-time) (-> arg0 start-time))))))) (defun part-tracker-track-target ((arg0 part-tracker)) (set! (-> arg0 linger-callback) (-> arg0 callback)) (let* ((v1-1 *target*) - (v1-3 (if (not v1-1) - (-> arg0 root trans) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data 5)) - ) - ) - (v0-1 (-> arg0 root trans)) - ) + (v1-3 (if (not v1-1) (-> arg0 root trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data 5)))) + (v0-1 (-> arg0 root trans))) (set! (-> v0-1 quad) (-> v1-3 quad)) - v0-1 - ) - ) + v0-1)) (defpartgroup group-eco-blue :id 42 :bounds (static-bspherem 0 0 0 1) - :parts ((sp-item 2 :flags (launch-asap) :binding 3) - (sp-item 3 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 5) - (sp-item 3 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 5) - (sp-item 3 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 5) - (sp-item 3 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 5) - (sp-item 3 :fade-after (meters 130) :flags (start-dead launch-asap) :binding 5) - (sp-item 3 :flags (start-dead launch-asap) :binding 5) - (sp-item 5 :flags (start-dead launch-asap) :binding 7) - (sp-item 5 :flags (start-dead launch-asap) :binding 8) - (sp-item 5 :flags (start-dead launch-asap) :binding 9) - (sp-item 5 :flags (start-dead launch-asap) :binding 7) - (sp-item 5 :flags (start-dead launch-asap) :binding 8) - (sp-item 5 :flags (start-dead launch-asap) :binding 9) - (sp-item 7 :fade-after (meters 60) :flags (start-dead) :binding 10) - (sp-item 8 :fade-after (meters 70) :flags (start-dead) :binding 10) - (sp-item 9 :fade-after (meters 80) :flags (start-dead) :binding 10) - (sp-item 7 :fade-after (meters 90) :flags (start-dead) :binding 10) - (sp-item 8 :fade-after (meters 100) :flags (start-dead) :binding 10) - (sp-item 9 :fade-after (meters 100) :flags (start-dead) :binding 10) - (sp-item 10 :flags (start-dead)) - ) - ) + :parts + ((sp-item 2 :flags (launch-asap) :binding 3) (sp-item 3 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 5) + (sp-item 3 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 5) + (sp-item 3 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 5) + (sp-item 3 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 5) + (sp-item 3 :fade-after (meters 130) :flags (start-dead launch-asap) :binding 5) + (sp-item 3 :flags (start-dead launch-asap) :binding 5) + (sp-item 5 :flags (start-dead launch-asap) :binding 7) + (sp-item 5 :flags (start-dead launch-asap) :binding 8) + (sp-item 5 :flags (start-dead launch-asap) :binding 9) + (sp-item 5 :flags (start-dead launch-asap) :binding 7) + (sp-item 5 :flags (start-dead launch-asap) :binding 8) + (sp-item 5 :flags (start-dead launch-asap) :binding 9) + (sp-item 7 :fade-after (meters 60) :flags (start-dead) :binding 10) + (sp-item 8 :fade-after (meters 70) :flags (start-dead) :binding 10) + (sp-item 9 :fade-after (meters 80) :flags (start-dead) :binding 10) + (sp-item 7 :fade-after (meters 90) :flags (start-dead) :binding 10) + (sp-item 8 :fade-after (meters 100) :flags (start-dead) :binding 10) + (sp-item 9 :fade-after (meters 100) :flags (start-dead) :binding 10) + (sp-item 10 :flags (start-dead)))) (defpart 2 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 4)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:timer (seconds -0.005)) - (:flags (bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defpart 3 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 6.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.3) (meters 0.15)) - (:scale-x (meters 2) (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 0.0 32.0) - (:g 32.0 96.0) - (:b 128.0 128.0) - (:a 32.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.0148148155) (meters 0.0044444446)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:timer (seconds -0.005)) - (:flags (bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 4) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.15)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 32.0 96.0) + (:b 128.0 128.0) + (:a 32.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 4))) (defpart 4 - :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5)))) (defpart 5 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.2) (meters 0.1)) - (:scale-x (meters 0.8) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 96.0) - (:g 96.0) - (:b 192.0) - (:a 32.0 32.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.0148148155)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees 269.52002) (degrees 208.99998)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 6) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.8) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 32.0 32.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 269.52002) (degrees 208.99998)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 6))) (defpart 6 - :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5)))) (defpart 7 - :init-specs ((:texture (new 'static 'texture-id :index #x1f :page #x2)) - (:num 0.0 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.6) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1f :page #x2)) (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 8 - :init-specs ((:texture (new 'static 'texture-id :index #x23 :page #x2)) - (:num 0.0 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.6) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x23 :page #x2)) (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 9 - :init-specs ((:texture (new 'static 'texture-id :index #x24 :page #x2)) - (:num 0.0 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.6) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x24 :page #x2)) (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 10 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 0.2 0.2) - (:scale-x (meters 1) (meters 0.5)) - (:scale-y :copy scale-x) - (:r 32.0) - (:g 32.0) - (:b 192.0) - (:a 96.0 64.0) - (:timer (seconds 0.017)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 0.2 0.2) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 96.0 64.0) + (:timer (seconds 0.017)) + (:flags (bit2 bit3 bit14)))) (defpartgroup group-eco-blue-collect :id 43 :duration (seconds 0.5) :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) - :parts ((sp-item 11 :flags (launch-asap) :binding 12) - (sp-item 12 :flags (start-dead launch-asap) :binding 13) - (sp-item 12 :flags (start-dead launch-asap) :binding 14) - (sp-item 12 :flags (start-dead launch-asap) :binding 13) - (sp-item 12 :flags (start-dead launch-asap) :binding 14) - (sp-item 12 :flags (start-dead launch-asap) :binding 147) - (sp-item 13 :fade-after (meters 40) :flags (start-dead)) - (sp-item 13 :fade-after (meters 40) :flags (start-dead)) - (sp-item 13 :fade-after (meters 40) :flags (start-dead)) - (sp-item 13 :fade-after (meters 40) :flags (start-dead)) - (sp-item 14 :fade-after (meters 40) :flags (start-dead)) - (sp-item 14 :fade-after (meters 40) :flags (start-dead)) - (sp-item 14 :fade-after (meters 40) :flags (start-dead)) - (sp-item 14 :fade-after (meters 40) :flags (start-dead)) - (sp-item 147 :fade-after (meters 40) :flags (start-dead)) - (sp-item 147 :fade-after (meters 40) :flags (start-dead)) - (sp-item 147 :fade-after (meters 40) :flags (start-dead)) - (sp-item 147 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 11 :flags (launch-asap) :binding 12) (sp-item 12 :flags (start-dead launch-asap) :binding 13) + (sp-item 12 :flags (start-dead launch-asap) :binding 14) + (sp-item 12 :flags (start-dead launch-asap) :binding 13) + (sp-item 12 :flags (start-dead launch-asap) :binding 14) + (sp-item 12 :flags (start-dead launch-asap) :binding 147) + (sp-item 13 :fade-after (meters 40) :flags (start-dead)) + (sp-item 13 :fade-after (meters 40) :flags (start-dead)) + (sp-item 13 :fade-after (meters 40) :flags (start-dead)) + (sp-item 13 :fade-after (meters 40) :flags (start-dead)) + (sp-item 14 :fade-after (meters 40) :flags (start-dead)) + (sp-item 14 :fade-after (meters 40) :flags (start-dead)) + (sp-item 14 :fade-after (meters 40) :flags (start-dead)) + (sp-item 14 :fade-after (meters 40) :flags (start-dead)) + (sp-item 147 :fade-after (meters 40) :flags (start-dead)) + (sp-item 147 :fade-after (meters 40) :flags (start-dead)) + (sp-item 147 :fade-after (meters 40) :flags (start-dead)) + (sp-item 147 :fade-after (meters 40) :flags (start-dead)))) (defpart 11 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 96.0) - (:g 96.0) - (:b 192.0) - (:a 64.0) - (:fade-a -3.2) - (:timer (seconds 0.5)) - (:flags (bit3 bit14)) - (:func 'part-tracker-track-root) - (:next-time (seconds 0.05)) - (:next-launcher 148) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (bit3 bit14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 148))) (defpart 12 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 5.0) - (:y (meters -4) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.75) (meters 0.5)) - (:scale-y :copy scale-x) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) - (:vel-y (meters 0)) - (:vel-z (meters 0.08)) - (:accel-z (meters -0.0053333333)) - (:timer (seconds 0.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.75) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 13 - :init-specs ((:texture (new 'static 'texture-id :index #x1f :page #x2)) - (:num 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1f :page #x2)) (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 14 - :init-specs ((:texture (new 'static 'texture-id :index #x23 :page #x2)) - (:num 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x23 :page #x2)) (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 147 - :init-specs ((:texture (new 'static 'texture-id :index #x24 :page #x2)) - (:num 1.0) - (:scale-x (meters 0.2) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.15) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0 64.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x24 :page #x2)) (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpartgroup group-part-vent-blue-active :id 44 :bounds (static-bspherem 0 5 0 5) - :parts ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) - (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 155) - (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 154) - (sp-item 150) - (sp-item 151 :fade-after (meters 120) :falloff-to (meters 120)) - (sp-item 152 :fade-after (meters 120) :falloff-to (meters 120)) - (sp-item 153 :fade-after (meters 120) :falloff-to (meters 120)) - (sp-item 154 :fade-after (meters 30) :falloff-to (meters 30) :flags (start-dead)) - (sp-item 155 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 156 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 154 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) - (sp-item 155 :fade-after (meters 100) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 156 :fade-after (meters 110) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 154 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) - (sp-item 155 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) - ) - ) + :parts + ((sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 156) (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 155) + (sp-item 149 :fade-after (meters 140) :falloff-to (meters 140) :binding 154) + (sp-item 150) + (sp-item 151 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 152 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 153 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 154 :fade-after (meters 30) :falloff-to (meters 30) :flags (start-dead)) + (sp-item 155 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 156 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 154 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 155 :fade-after (meters 100) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 156 :fade-after (meters 110) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 154 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) + (sp-item 155 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)))) (defpartgroup group-part-vent-blue-inactive :id 45 :bounds (static-bspherem 0 5 0 5) - :parts ((sp-item 149 :fade-after (meters 100)) (sp-item 150)) - ) + :parts ((sp-item 149 :fade-after (meters 100)) (sp-item 150))) (defpart 150 - :init-specs ((:texture (new 'static 'texture-id :index #x4 :page #x2)) - (:num 0.1 1.0) - (:x (meters -0.75) (meters 1.5)) - (:y (meters 0.5)) - (:z (meters -0.75) (meters 1.5)) - (:scale-x (meters 1.5) (meters 1.4)) - (:scale-y :copy scale-x) - (:r 32.0) - (:g 32.0) - (:b 192.0) - (:a 64.0) - (:vel-y (meters 0.016666668) (meters 0.016666668)) - (:fade-a -0.2) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x4 :page #x2)) (:num 0.1 1.0) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 1.4)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 64.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:fade-a -0.2) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 149 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 0.05 0.1) - (:x (meters -0.75) (meters 1.5)) - (:y (meters 0.5)) - (:z (meters -0.75) (meters 1.5)) - (:scale-x (meters 1.5) (meters 0.4)) - (:scale-y :copy scale-x) - (:r 64.0) - (:g 64.0) - (:b 192.0) - (:a 96.0) - (:vel-y (meters 0.01) (meters 0.01)) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 0.05 0.1) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 192.0) + (:a 96.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 156 - :init-specs ((:texture (new 'static 'texture-id :index #x1f :page #x2)) - (:num 1.0) - (:scale-x (meters 0.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1f :page #x2)) (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 155 - :init-specs ((:texture (new 'static 'texture-id :index #x23 :page #x2)) - (:num 1.0) - (:scale-x (meters 0.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x23 :page #x2)) (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 154 - :init-specs ((:texture (new 'static 'texture-id :index #x24 :page #x2)) - (:num 1.0) - (:scale-x (meters 0.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 64.0) - (:g 64.0) - (:b 128.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.3)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x24 :page #x2)) (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 151 - :init-specs ((:texture (new 'static 'texture-id :index #x1f :page #x2)) - (:num 0.1 0.5) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 10) (degrees 160)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 128.0) - (:g 128.0) - (:b 255.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.305)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1f :page #x2)) (:num 0.1 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 152 - :init-specs ((:texture (new 'static 'texture-id :index #x23 :page #x2)) - (:num 0.2 0.4) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 10) (degrees 160)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 128.0) - (:g 128.0) - (:b 255.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.305)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x23 :page #x2)) (:num 0.2 0.4) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 153 - :init-specs ((:texture (new 'static 'texture-id :index #x24 :page #x2)) - (:num 0.3 0.1) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 1.5)) - (:rot-x 4) - (:rot-z (degrees 10) (degrees 160)) - (:scale-y (meters 0.2) (meters 0.1)) - (:r 128.0) - (:g 128.0) - (:b 255.0) - (:a 128.0) - (:fade-a -1.4) - (:timer (seconds 0.305)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.035)) - (:next-launcher 146) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x24 :page #x2)) (:num 0.3 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.035)) + (:next-launcher 146))) (defpart 146 - :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.0) (:fade-g -1.0) (:fade-a -2.0)) - ) + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.0) (:fade-g -1.0) (:fade-a -2.0))) (defpartgroup group-eco-red :id 48 :bounds (static-bspherem 0 0 0 1) - :parts ((sp-item 160 :flags (launch-asap) :binding 161) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 161 :flags (start-dead launch-asap) :binding 162) - (sp-item 162 :flags (start-dead launch-asap) :binding 163) - (sp-item 162 :flags (start-dead launch-asap) :binding 163) - (sp-item 162 :flags (start-dead launch-asap) :binding 163) - (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) - (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) - (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) - (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - ) - ) + :parts + ((sp-item 160 :flags (launch-asap) :binding 161) (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 161 :flags (start-dead launch-asap) :binding 162) + (sp-item 162 :flags (start-dead launch-asap) :binding 163) + (sp-item 162 :flags (start-dead launch-asap) :binding 163) + (sp-item 162 :flags (start-dead launch-asap) :binding 163) + (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) + (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) + (sp-item 163 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 164) + (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 164 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)))) (defpart 160 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 4)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:timer (seconds -0.005)) - (:flags (bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defpart 161 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 6.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.15) (meters 0.2)) - (:scale-x (meters 2) (meters 2)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 24.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.0148148155) (meters 0.0044444446)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:timer (seconds -0.005)) - (:flags (bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 165) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 165))) (defpart 165 - :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5)))) (defpart 162 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.25) (meters 0.1)) - (:scale-x (meters 0.6) (meters 0.4)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 32.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.0148148155)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 166) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 166))) (defpart 166 - :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5)))) (defpart 163 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 16)) - (:y (meters 0) (meters 16)) - (:z (meters 0.07) (meters 0.03)) - (:scale-x (meters 0.6) (meters 0.6)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 32.0) - (:vel-x (meters 0.11259259)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 166) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.07) (meters 0.03)) + (:scale-x (meters 0.6) (meters 0.6)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 166))) (defpart 164 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 0.1 1.0) - (:scale-x (meters 0.4) (meters 0.2)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 32.0 32.0) - (:scalevel-x (meters -0.00038095238)) - (:rotvel-z (degrees -1.2) (degrees 2.4)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.4) - (:fade-a -0.01904762) - (:accel-y (meters 0.000100000005) (meters 0.00015)) - (:timer (seconds 0.1) (seconds 0.497)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 167) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 0.1 1.0) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.00038095238)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 167))) (defpart 167 - :init-specs ((:fade-g 0.0)) - ) + :init-specs ((:fade-g 0.0))) (defpartgroup group-eco-red-collect :id 49 @@ -710,1262 +620,1138 @@ :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 168 :flags (launch-asap) :binding 169) - (sp-item 169 :flags (start-dead launch-asap) :binding 170) - (sp-item 169 :flags (start-dead launch-asap) :binding 170) - (sp-item 169 :flags (start-dead launch-asap) :binding 170) - (sp-item 169 :flags (start-dead launch-asap) :binding 170) - (sp-item 169 :flags (start-dead launch-asap) :binding 170) - (sp-item 170 :fade-after (meters 40) :flags (start-dead)) - (sp-item 170 :fade-after (meters 40) :flags (start-dead)) - (sp-item 170 :fade-after (meters 40) :flags (start-dead)) - (sp-item 170 :fade-after (meters 40) :flags (start-dead)) - (sp-item 170 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 168 :flags (launch-asap) :binding 169) (sp-item 169 :flags (start-dead launch-asap) :binding 170) + (sp-item 169 :flags (start-dead launch-asap) :binding 170) + (sp-item 169 :flags (start-dead launch-asap) :binding 170) + (sp-item 169 :flags (start-dead launch-asap) :binding 170) + (sp-item 169 :flags (start-dead launch-asap) :binding 170) + (sp-item 170 :fade-after (meters 40) :flags (start-dead)) + (sp-item 170 :fade-after (meters 40) :flags (start-dead)) + (sp-item 170 :fade-after (meters 40) :flags (start-dead)) + (sp-item 170 :fade-after (meters 40) :flags (start-dead)) + (sp-item 170 :fade-after (meters 40) :flags (start-dead)))) (defpart 168 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 128.0) - (:fade-a -3.2) - (:timer (seconds 0.5)) - (:flags (bit3 bit14)) - (:func 'part-tracker-track-root) - (:next-time (seconds 0.05)) - (:next-launcher 148) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (bit3 bit14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 148))) (defpart 169 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 5.0) - (:y (meters -4) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.3) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 128.0) - (:b 0.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) - (:vel-y (meters 0)) - (:vel-z (meters 0.08)) - (:accel-z (meters -0.0053333333)) - (:timer (seconds 0.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 170 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 1.0) - (:scale-x (meters 1) (meters 0.5)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 64.0 32.0) - (:vel-y (meters 0.0033333334) (meters 0.006666667)) - (:scalevel-x (meters -0.005555555)) - (:rotvel-z (degrees -1.2) (degrees 2.4)) - (:scalevel-y :copy scalevel-x) - (:fade-g -2.0) - (:fade-a -0.22857143) - (:accel-y (meters 0.000100000005) (meters 0.00015)) - (:timer (seconds 0.18)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 171) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.005555555)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.0) + (:fade-a -0.22857143) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.18)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 171))) (defpartgroup group-part-vent-red-active :id 50 :bounds (static-bspherem 0 3 0 5) - :parts ((sp-item 172 :fade-after (meters 30) :period (seconds 1.1) :length (seconds 0.017) :binding 173) - (sp-item 172 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 173) - (sp-item 172 :fade-after (meters 90) :period (seconds 3.12) :length (seconds 0.017) :binding 173) - (sp-item 172 :fade-after (meters 130) :period (seconds 1.76) :length (seconds 0.017) :binding 173) - (sp-item 172 :fade-after (meters 170) :period (seconds 2.67) :length (seconds 0.017) :binding 173) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 173 :flags (start-dead launch-asap) :binding 174) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 174 :flags (start-dead launch-asap) :binding 175) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 50) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) - (sp-item 177) - ) - ) + :parts + ((sp-item 172 :fade-after (meters 30) :period (seconds 1.1) :length (seconds 0.017) :binding 173) (sp-item 172 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 173) + (sp-item 172 :fade-after (meters 90) :period (seconds 3.12) :length (seconds 0.017) :binding 173) + (sp-item 172 :fade-after (meters 130) :period (seconds 1.76) :length (seconds 0.017) :binding 173) + (sp-item 172 :fade-after (meters 170) :period (seconds 2.67) :length (seconds 0.017) :binding 173) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 173 :flags (start-dead launch-asap) :binding 174) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 174 :flags (start-dead launch-asap) :binding 175) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 50) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 175 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 177))) (defpartgroup group-part-vent-red-inactive :id 51 :bounds (static-bspherem 0 3 0 5) - :parts ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177)) - ) + :parts ((sp-item 176 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 177))) (defpart 177 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 0.6 0.6) - (:x (meters -0.75) (meters 1.5)) - (:y (meters 0.5)) - (:z (meters -0.75) (meters 1.5)) - (:scale-x (meters 1.9) (meters 1.9)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 32.0) - (:vel-y (meters 0.016666668) (meters 0.016666668)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:fade-a -0.10666667) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 176 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 0.1 0.3) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 64.0) - (:vel-y (meters 0.01) (meters 0.01)) - (:rotvel-z (degrees -0.1) (degrees 0.1)) - (:fade-a -0.21333334) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 172 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 1.5)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:a 1.0) - (:vel-y (meters 0.006666667) (meters 0.0033333334)) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:conerot-x (degrees 0) (degrees 5)) - (:rotate-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)))) (defpart 173 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.5)) - (:scale-x (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 128.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.017777778)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:fade-a -0.28444445) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 174 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.25) (meters 0.1)) - (:scale-x (meters 1) (meters 0.5)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 32.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.0148148155)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 175 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 0.1 1.0) - (:scale-x (meters 1) (meters 0.5)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 64.0 32.0) - (:vel-y (meters 0.0033333334) (meters 0.006666667)) - (:scalevel-x (meters -0.0023809525)) - (:rotvel-z (degrees -1.2) (degrees 2.4)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.4) - (:fade-a -0.07619048) - (:accel-y (meters 0.000100000005) (meters 0.00015)) - (:timer (seconds 0.1) (seconds 0.497)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 171) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 0.1 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.0023809525)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.07619048) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 171))) (defpart 171 - :init-specs ((:fade-g 0.0)) - ) + :init-specs ((:fade-g 0.0))) (defpartgroup group-part-vent-yellow-active :id 52 :bounds (static-bspherem 0 3 0 5) - :parts ((sp-item 178 :fade-after (meters 40) :period (seconds 1.1) :length (seconds 0.017) :binding 179) - (sp-item 178 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 179) - (sp-item 178 :fade-after (meters 80) :period (seconds 3.12) :length (seconds 0.017) :binding 179) - (sp-item 178 :fade-after (meters 100) :period (seconds 1.76) :length (seconds 0.017) :binding 179) - (sp-item 178 :fade-after (meters 130) :period (seconds 2.67) :length (seconds 0.017) :binding 179) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 179 :flags (start-dead launch-asap) :binding 180) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 180 :flags (start-dead launch-asap) :binding 181) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) - (sp-item 183) - ) - ) + :parts + ((sp-item 178 :fade-after (meters 40) :period (seconds 1.1) :length (seconds 0.017) :binding 179) (sp-item 178 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 179) + (sp-item 178 :fade-after (meters 80) :period (seconds 3.12) :length (seconds 0.017) :binding 179) + (sp-item 178 :fade-after (meters 100) :period (seconds 1.76) :length (seconds 0.017) :binding 179) + (sp-item 178 :fade-after (meters 130) :period (seconds 2.67) :length (seconds 0.017) :binding 179) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 179 :flags (start-dead launch-asap) :binding 180) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 180 :flags (start-dead launch-asap) :binding 181) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 181 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 183))) (defpartgroup group-part-vent-yellow-inactive :id 53 :bounds (static-bspherem 0 3 0 5) - :parts ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183)) - ) + :parts ((sp-item 182 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 183))) (defpart 183 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 0.6 0.6) - (:x (meters -0.75) (meters 1.5)) - (:y (meters 0.5)) - (:z (meters -0.75) (meters 1.5)) - (:scale-x (meters 1.9) (meters 1.9)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 92.0 32.0) - (:g 32.0 92.0) - (:b 0.0) - (:a 32.0) - (:vel-y (meters 0.016666668) (meters 0.016666668)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:fade-a -0.10666667) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 92.0 32.0) + (:g 32.0 92.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 182 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 0.1 0.3) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 128.0) - (:b 0.0) - (:a 64.0) - (:vel-y (meters 0.01) (meters 0.01)) - (:rotvel-z (degrees -0.1) (degrees 0.1)) - (:fade-a -0.21333334) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 178 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 1.5)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:a 1.0) - (:vel-y (meters 0.013333334) (meters 0.013333334)) - (:timer (seconds 1.25)) - (:flags (bit2 bit3 bit14)) - (:conerot-x (degrees 0) (degrees 5)) - (:rotate-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:timer (seconds 1.25)) + (:flags (bit2 bit3 bit14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)))) (defpart 179 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 16)) - (:y (meters 0)) - (:z (meters 0.2) (meters 0.2)) - (:scale-x (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 128.0) - (:vel-x (meters 0.10666667)) - (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) - (:fade-a -0.34133333) - (:timer (seconds 1.25)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.10666667)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 180 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 16)) - (:y (meters 0) (meters 16)) - (:z (meters 0.2)) - (:scale-x (meters 1) (meters 0.5)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 128.0) - (:vel-x (meters 0.11259259)) - (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) - (:fade-a -0.34133333) - (:timer (seconds 1.25)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.2)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.11259259)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 181 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 0.5 2.0) - (:y (meters -0.05)) - (:scale-x (meters 0.4) (meters 0.1)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 64.0 64.0) - (:vel-y (meters 0.0023333333) (meters 0.0016666667)) - (:scalevel-x (meters -0.0016666667)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.4) - (:fade-a -0.024242423) - (:accel-y (meters -0.000100000005) (meters -0.0003)) - (:friction 0.93) - (:timer (seconds 0.1) (seconds 0.697)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 190) - (:conerot-x (degrees 0) (degrees 180)) - (:conerot-y (degrees 0) (degrees 360)) - (:conerot-radius (meters 0.05)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 0.5 2.0) + (:y (meters -0.05)) + (:scale-x (meters 0.4) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 64.0) + (:vel-y (meters 0.0023333333) (meters 0.0016666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.024242423) + (:accel-y (meters -0.000100000005) (meters -0.0003)) + (:friction 0.93) + (:timer (seconds 0.1) (seconds 0.697)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 190) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.05)))) (defpart 190 - :init-specs ((:fade-r 0.0)) - ) + :init-specs ((:fade-r 0.0))) (defpartgroup group-eco-yellow :id 56 :bounds (static-bspherem 0 0 0 1) - :parts ((sp-item 191 :flags (launch-asap) :binding 192) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 192 :flags (start-dead launch-asap) :binding 193) - (sp-item 193 :flags (start-dead launch-asap) :binding 194) - (sp-item 193 :flags (start-dead launch-asap) :binding 194) - (sp-item 193 :flags (start-dead launch-asap) :binding 194) - (sp-item 193 :flags (start-dead launch-asap) :binding 194) - (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) - (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) - (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) - (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) - (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) - ) - ) + :parts + ((sp-item 191 :flags (launch-asap) :binding 192) (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 192 :flags (start-dead launch-asap) :binding 193) + (sp-item 193 :flags (start-dead launch-asap) :binding 194) + (sp-item 193 :flags (start-dead launch-asap) :binding 194) + (sp-item 193 :flags (start-dead launch-asap) :binding 194) + (sp-item 193 :flags (start-dead launch-asap) :binding 194) + (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) + (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) + (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) + (sp-item 194 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 195) + (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 195 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)))) (defpart 191 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 4)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:timer (seconds -0.005)) - (:flags (bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defpart 192 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 5.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.15) (meters 0.2)) - (:scale-x (meters 2) (meters 2)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 192.0) - (:b 0.0) - (:a 16.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.0148148155) (meters 0.0044444446)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:timer (seconds -0.005)) - (:flags (bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 196) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 5.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 16.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 196))) (defpart 196 - :init-specs ((:fade-a -0.10666667) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.10666667) (:timer (seconds 0.5)))) (defpart 193 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.75) (meters 0.1)) - (:scale-x (meters 0.4) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 32.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.0148148155)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 197) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.75) (meters 0.1)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 197))) (defpart 197 - :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5)))) (defpart 194 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters 0) (meters 16)) - (:y (meters 0) (meters 16)) - (:z (meters 0.12) (meters 0.03)) - (:scale-x (meters 0.4) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 64.0) - (:a 32.0) - (:vel-x (meters 0.11259259)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 197) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.12) (meters 0.03)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 197))) (defpart 195 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 0.1 1.0) - (:scale-x (meters 0.3) (meters 0.1)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 32.0 32.0) - (:scalevel-x (meters -0.0006190476)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.4) - (:fade-a -0.01904762) - (:accel-y (meters -0.000100000005) (meters -0.00015)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 198) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 0.1 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 198))) (defpart 198 - :init-specs ((:fade-g 0.0)) - ) + :init-specs ((:fade-g 0.0))) (defpartgroup group-eco-yellow-collect :id 57 :duration (seconds 0.5) :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) - :parts ((sp-item 199 :flags (launch-asap) :binding 200) - (sp-item 200 :flags (start-dead launch-asap) :binding 201) - (sp-item 200 :flags (start-dead launch-asap) :binding 201) - (sp-item 200 :flags (start-dead launch-asap) :binding 201) - (sp-item 200 :flags (start-dead launch-asap) :binding 201) - (sp-item 200 :flags (start-dead launch-asap) :binding 201) - (sp-item 201 :fade-after (meters 40) :flags (start-dead)) - (sp-item 201 :fade-after (meters 40) :flags (start-dead)) - (sp-item 201 :fade-after (meters 40) :flags (start-dead)) - (sp-item 201 :fade-after (meters 40) :flags (start-dead)) - (sp-item 201 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 199 :flags (launch-asap) :binding 200) (sp-item 200 :flags (start-dead launch-asap) :binding 201) + (sp-item 200 :flags (start-dead launch-asap) :binding 201) + (sp-item 200 :flags (start-dead launch-asap) :binding 201) + (sp-item 200 :flags (start-dead launch-asap) :binding 201) + (sp-item 200 :flags (start-dead launch-asap) :binding 201) + (sp-item 201 :fade-after (meters 40) :flags (start-dead)) + (sp-item 201 :fade-after (meters 40) :flags (start-dead)) + (sp-item 201 :fade-after (meters 40) :flags (start-dead)) + (sp-item 201 :fade-after (meters 40) :flags (start-dead)) + (sp-item 201 :fade-after (meters 40) :flags (start-dead)))) (defpart 199 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 192.0) - (:b 0.0) - (:a 64.0) - (:fade-a -3.2) - (:timer (seconds 0.5)) - (:flags (bit3 bit14)) - (:func 'part-tracker-track-root) - (:next-time (seconds 0.05)) - (:next-launcher 148) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (bit3 bit14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 148))) (defpart 200 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 5.0) - (:y (meters -4) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.3) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 128.0) - (:b 0.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) - (:vel-y (meters 0)) - (:vel-z (meters 0.08)) - (:accel-z (meters -0.0053333333)) - (:timer (seconds 0.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 201 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:scale-x (meters 0.3) (meters 0.1)) - (:scale-y :copy scale-x) - (:r 100.0 28.0) - (:g 64.0 64.0) - (:b 0.0) - (:a 32.0 32.0) - (:scalevel-x (meters -0.0006190476)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.4) - (:fade-a -0.01904762) - (:accel-y (meters -0.000100000005) (meters -0.00015)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 198) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 198))) (defpartgroup group-eco-green :id 58 :bounds (static-bspherem 0 0 0 1) - :parts ((sp-item 202 :flags (launch-asap) :binding 203) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 203 :flags (start-dead launch-asap) :binding 204) - (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) - (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) - (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) - (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) - (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) - (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) - (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) - ) - ) + :parts + ((sp-item 202 :flags (launch-asap) :binding 203) (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 203 :flags (start-dead launch-asap) :binding 204) + (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) + (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) + (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) + (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) + (sp-item 204 :fade-after (meters 90) :flags (start-dead launch-asap) :binding 205) + (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 205 :fade-after (meters 40) :falloff-to (meters 60) :flags (start-dead)))) (defpart 202 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:x (meters 4)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:r 0.0) - (:g 0.0) - (:a 1.0) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:a 1.0) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defpart 203 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 6.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.3) (meters 0.25)) - (:scale-x (meters 2) (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:a 24.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.0148148155) (meters 0.0044444446)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:timer (seconds -0.005)) - (:flags (bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 206) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.25)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 206))) (defpart 206 - :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5)))) (defpart 204 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.3)) - (:scale-x (meters 0.3) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 64.0 64.0) - (:g 255.0) - (:a 64.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.053333335) (meters 0.0148148155)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 207) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 255.0) + (:a 64.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.053333335) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 207))) (defpart 207 - :init-specs ((:fade-a -0.42666668) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.42666668) (:timer (seconds 0.5)))) (defpart 205 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 0.25) - (:y (meters -0.05)) - (:scale-x (meters 0.3)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 255.0) - (:b 0.0) - (:a 48.0) - (:scalevel-x (meters -0.00075757573)) - (:scalevel-y :copy scalevel-x) - (:fade-r -2.8333333) - (:accel-y (meters -0.00015)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 208) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 48.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 208))) (defpart 208 - :init-specs ((:fade-r 0.0)) - ) + :init-specs ((:fade-r 0.0))) (defpartgroup group-eco-green-pill :id 59 :bounds (static-bspherem 0 0 0 0.4) - :parts ((sp-item 209 :flags (launch-asap) :binding 210) - (sp-item 210 :flags (start-dead launch-asap) :binding 211) - (sp-item 211 :flags (start-dead launch-asap) :binding 212) - (sp-item 212 :flags (start-dead launch-asap) :binding 213) - (sp-item 212 :flags (start-dead launch-asap)) - (sp-item 212 :flags (start-dead launch-asap)) - (sp-item 212 :flags (start-dead launch-asap)) - (sp-item 213 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 209 :flags (launch-asap) :binding 210) (sp-item 210 :flags (start-dead launch-asap) :binding 211) + (sp-item 211 :flags (start-dead launch-asap) :binding 212) + (sp-item 212 :flags (start-dead launch-asap) :binding 213) + (sp-item 212 :flags (start-dead launch-asap)) + (sp-item 212 :flags (start-dead launch-asap)) + (sp-item 212 :flags (start-dead launch-asap)) + (sp-item 213 :fade-after (meters 40) :flags (start-dead)))) (defpart 209 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 1.0) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:a 0.0) - (:timer (seconds -0.005)) - (:flags (bit3 bit14)) - (:func 'eco-track-root-prim-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 214) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 1.0) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (bit3 bit14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 214))) (defpart 210 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.2) (meters 0.1)) - (:scale-x (meters 0.6) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:a 24.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.026666667) (meters 0.026666667)) - (:vel-y (meters 0.0014814815)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-track-root-prim-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 214) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.026666667) (meters 0.026666667)) + (:vel-y (meters 0.0014814815)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 214))) (defpart 214 - :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5)))) (defpart 211 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 3.0) - (:y (meters 0) (meters 16)) - (:z (meters 0) (meters 0.2)) - (:scale-x (meters 0.6) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:a 24.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.017777778)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-track-root-prim-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 214) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 3.0) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.2)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 214))) (defpart 212 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.2) (meters 0.05)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 255.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.10666667)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit7 bit14)) - (:func 'eco-fadeout) - (:next-time (seconds 0.035)) - (:next-launcher 215) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.2) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit7 bit14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 215))) (defpart 215 - :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5)))) (defpart 213 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 0.25) - (:y (meters -0.05)) - (:scale-x (meters 0.15)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 255.0) - (:b 0.0) - (:a 96.0) - (:scalevel-x (meters -0.00039393938)) - (:scalevel-y :copy scalevel-x) - (:fade-r -2.8333333) - (:accel-y (meters -0.000100000005)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 208) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00039393938)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 208))) (defpartgroup group-eco-green-pill-collect :id 60 :duration (seconds 0.5) :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) - :parts ((sp-item 216 :flags (launch-asap) :binding 217) - (sp-item 217 :flags (start-dead launch-asap) :binding 218) - (sp-item 217 :flags (start-dead launch-asap) :binding 218) - (sp-item 217 :flags (start-dead launch-asap) :binding 218) - (sp-item 217 :flags (start-dead launch-asap) :binding 218) - (sp-item 217 :flags (start-dead launch-asap) :binding 218) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 216 :flags (launch-asap) :binding 217) (sp-item 217 :flags (start-dead launch-asap) :binding 218) + (sp-item 217 :flags (start-dead launch-asap) :binding 218) + (sp-item 217 :flags (start-dead launch-asap) :binding 218) + (sp-item 217 :flags (start-dead launch-asap) :binding 218) + (sp-item 217 :flags (start-dead launch-asap) :binding 218) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)))) (defpartgroup group-eco-green-collect :id 61 :duration (seconds 0.5) :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) - :parts ((sp-item 216 :flags (launch-asap) :binding 219) - (sp-item 219 :flags (start-dead launch-asap) :binding 218) - (sp-item 219 :flags (start-dead launch-asap) :binding 218) - (sp-item 219 :flags (start-dead launch-asap) :binding 218) - (sp-item 219 :flags (start-dead launch-asap) :binding 218) - (sp-item 219 :flags (start-dead launch-asap) :binding 218) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - (sp-item 218 :fade-after (meters 40) :flags (start-dead)) - ) - ) + :parts + ((sp-item 216 :flags (launch-asap) :binding 219) (sp-item 219 :flags (start-dead launch-asap) :binding 218) + (sp-item 219 :flags (start-dead launch-asap) :binding 218) + (sp-item 219 :flags (start-dead launch-asap) :binding 218) + (sp-item 219 :flags (start-dead launch-asap) :binding 218) + (sp-item 219 :flags (start-dead launch-asap) :binding 218) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)) + (sp-item 218 :fade-after (meters 40) :flags (start-dead)))) (defpart 216 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:a 64.0) - (:fade-a -3.2) - (:timer (seconds 0.5)) - (:flags (bit3 bit14)) - (:func 'part-tracker-track-root) - (:next-time (seconds 0.05)) - (:next-launcher 148) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (bit3 bit14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 148))) (defpart 148 - :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0)) - ) + :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0))) (defpart 219 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 5.0) - (:y (meters -4) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.3) (meters 0.2)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 255.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) - (:vel-y (meters 0)) - (:vel-z (meters 0.08)) - (:accel-z (meters -0.0053333333)) - (:timer (seconds 0.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 217 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters -4) (meters 16)) - (:z (meters 0.08)) - (:scale-x (meters 0.25) (meters 0.05)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 255.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.017777778) (meters 0.017777778)) - (:vel-y (meters 0)) - (:vel-z (meters 0.04)) - (:accel-z (meters -0.0026666666)) - (:timer (seconds 0.5)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.25) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0.04)) + (:accel-z (meters -0.0026666666)) + (:timer (seconds 0.5)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 220 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters -0.05)) - (:scale-x (meters 0.3)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 255.0) - (:b 0.0) - (:a 96.0) - (:scalevel-x (meters -0.00075757573)) - (:scalevel-y :copy scalevel-x) - (:fade-r -2.8333333) - (:accel-y (meters -0.000100000005)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 221) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 221))) (defpart 218 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters -0.05)) - (:scale-x (meters 0.2)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 255.0) - (:b 0.0) - (:a 96.0) - (:scalevel-x (meters -0.0004545455)) - (:scalevel-y :copy scalevel-x) - (:fade-r -2.8333333) - (:accel-y (meters -0.000100000005)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 221) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0004545455)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 221))) (defpartgroup group-part-vent-green-active :id 62 :bounds (static-bspherem 0 5 0 5) - :parts ((sp-item 222 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 0.16) :length (seconds 0.017) :binding 223) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) - (sp-item 225 :fade-after (meters 100)) - (sp-item 226) - ) - ) + :parts + ((sp-item 222 :fade-after (meters 80) + :falloff-to (meters 80) + :period (seconds 0.16) + :length (seconds 0.017) + :binding 223) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 223 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 224) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 224 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 225 :fade-after (meters 100)) + (sp-item 226))) (defpart 226 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 0.6 0.6) - (:x (meters -0.75) (meters 1.5)) - (:y (meters 0.5)) - (:z (meters -0.75) (meters 1.5)) - (:scale-x (meters 1.9) (meters 1.9)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 0.0 64.0) - (:g 92.0 32.0) - (:b 0.0) - (:a 32.0) - (:vel-y (meters 0.016666668) (meters 0.016666668)) - (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) - (:fade-a -0.10666667) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 92.0 32.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 225 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 0.1 0.3) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 0.4)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 128.0) - (:b 0.0) - (:a 64.0) - (:vel-y (meters 0.01) (meters 0.01)) - (:rotvel-z (degrees -0.1) (degrees 0.1)) - (:fade-a -0.21333334) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)))) (defpart 222 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:x (meters -1) (meters 2)) - (:scale-x (meters 0.01)) - (:scale-y :copy scale-x) - (:vel-y (meters 0.006666667) (meters 0.0033333334)) - (:timer (seconds 2.5)) - (:flags (bit3 bit14)) - (:rotate-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:x (meters -1) (meters 2)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:timer (seconds 2.5)) + (:flags (bit3 bit14)) + (:rotate-y (degrees 0) (degrees 360)))) (defpart 223 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.2) (meters 0.6)) - (:scale-x (meters 0.3) (meters 0.3)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 255.0) - (:b 0.0) - (:a 127.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.053333335) (meters 0.053333335)) - (:vel-y (meters 0)) - (:vel-z (meters 0)) - (:fade-r -0.2) - (:timer (seconds 2) (seconds 0.497)) - (:flags (bit2 bit3 bit7 bit14)) - (:next-time (seconds 1.5) (seconds 0.497)) - (:next-launcher 227) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 127.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.053333335) (meters 0.053333335)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:fade-r -0.2) + (:timer (seconds 2) (seconds 0.497)) + (:flags (bit2 bit3 bit7 bit14)) + (:next-time (seconds 1.5) (seconds 0.497)) + (:next-launcher 227))) (defpart 227 - :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5))) - ) + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5)))) (defpart 224 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:scale-x (meters 0.2)) - (:scale-y :copy scale-x) - (:r 255.0) - (:g 255.0) - (:b 0.0) - (:a 96.0) - (:scalevel-x (meters -0.0006060606)) - (:scalevel-y :copy scalevel-x) - (:fade-r -2.8333333) - (:accel-y (meters -0.00020000001)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.3)) - (:next-launcher 208) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0006060606)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.00020000001)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.3)) + (:next-launcher 208))) (defpartgroup group-fuel-cell-starburst :id 63 :bounds (static-bspherem 0 0.5 0 1.5) - :parts ((sp-item 228 :fade-after (meters 35)) - (sp-item 229 :fade-after (meters 20)) - (sp-item 230 :flags (bit1 launch-asap)) - (sp-item 231 :flags (bit1 launch-asap)) - ) - ) + :parts + ((sp-item 228 :fade-after (meters 35)) (sp-item 229 :fade-after (meters 20)) + (sp-item 230 :flags (bit1 launch-asap)) + (sp-item 231 :flags (bit1 launch-asap)))) (defpart 228 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 0.5) - (:scale-x (meters 0.5) (meters 0.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.1) (meters 0.8)) - (:r 0.0 1 255.0) - (:g 0.0 1 255.0) - (:b 0.0 1 255.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.15) (degrees 0.3)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 0.35555556) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root-prim) - (:next-time (seconds 0.3)) - (:next-launcher 232) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.3)) + (:next-launcher 232))) (defpart 232 - :init-specs ((:fade-a -0.53333336)) - ) + :init-specs ((:fade-a -0.53333336))) (defpart 229 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 0.06) - (:scale-x (meters 2) (meters 0.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.2)) - (:r 0.0 1 255.0) - (:g 0.0 1 255.0) - (:b 0.0 1 255.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.15) (degrees 0.3)) - (:fade-a 0.32) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root-prim) - (:next-time (seconds 0.25)) - (:next-launcher 232) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.25)) + (:next-launcher 232))) (defpart 230 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 3.5)) - (:rot-z (degrees 0)) - (:scale-y (meters 3)) - (:r 192.0) - (:g 192.0) - (:b 0.0 128.0) - (:a 64.0) - (:rotvel-z (degrees -0.4)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 3)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 64.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defpart 231 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 4)) - (:rot-z (degrees 0)) - (:scale-y (meters 3.5)) - (:r 128.0) - (:g 128.0) - (:b 128.0) - (:a 64.0) - (:rotvel-z (degrees 0.3)) - (:timer (seconds -0.005)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root-prim) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds -0.005)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root-prim))) (defun sparticle-track-root-money ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (let ((v1-1 (-> arg1 key proc))) @@ -1973,156 +1759,139 @@ (let ((v1-3 (-> (the-as process-drawable v1-1) root trans))) (set! (-> arg2 x) (-> v1-3 x)) (set! (-> arg2 y) (+ 2048.0 (-> v1-3 y))) - (set! (-> arg2 z) (-> v1-3 z)) - ) - ) - ) + (set! (-> arg2 z) (-> v1-3 z))))) 0 - (none) - ) + (none)) (defpart 233 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 0.5) - (:scale-x (meters 0.5) (meters 0.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.1) (meters 0.8)) - (:r 192.0) - (:g 192.0) - (:b 0.0 128.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.15) (degrees 0.3)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 0.35555556) - (:timer (seconds 1)) - (:flags (bit2 bit3)) - (:next-time (seconds 0.3)) - (:next-launcher 234) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (bit2 bit3)) + (:next-time (seconds 0.3)) + (:next-launcher 234))) (defpart 234 - :init-specs ((:fade-a -0.53333336)) - ) + :init-specs ((:fade-a -0.53333336))) (defpart 235 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 0.06) - (:scale-x (meters 2) (meters 0.5)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.2)) - (:r 192.0) - (:g 192.0) - (:b 0.0 128.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.15) (degrees 0.3)) - (:fade-a 0.32) - (:timer (seconds 1)) - (:flags (bit2 bit3)) - (:next-time (seconds 0.25)) - (:next-launcher 234) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (bit2 bit3)) + (:next-time (seconds 0.25)) + (:next-launcher 234))) (defpart 236 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 2.5)) - (:rot-z (degrees 0)) - (:scale-y (meters 2)) - (:r 192.0) - (:g 192.0) - (:b 0.0 128.0) - (:a 32.0) - (:rotvel-z (degrees -0.4)) - (:timer (seconds 12)) - (:flags (bit2 bit3)) - (:func 'sparticle-track-root-money) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds 12)) + (:flags (bit2 bit3)) + (:func 'sparticle-track-root-money))) (defpart 237 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 3)) - (:rot-z (degrees 0)) - (:scale-y (meters 2.5)) - (:r 192.0) - (:g 192.0) - (:b 0.0 128.0) - (:a 32.0) - (:rotvel-z (degrees 0.3)) - (:timer (seconds 12)) - (:flags (bit2 bit3)) - (:func 'sparticle-track-root-money) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0)) + (:scale-y (meters 2.5)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 12)) + (:flags (bit2 bit3)) + (:func 'sparticle-track-root-money))) ;; og:preserve-this customized (defpart 238 - :init-specs ((:texture (new 'static 'texture-id :index #x2c :page #x2)) - (:num 1.0) - (:scale-x (meters 1.28)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 128.0) - (:b 128.0) - (:a 128.0) - (:timer (seconds 0.035)) - (:flags (bit2 bit3)) - (:func 'sparticle-track-root-money) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2c :page #x2)) (:num 1.0) + (:scale-x (meters 1.28)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 0.035)) + (:flags (bit2 bit3)) + (:func 'sparticle-track-root-money))) -(defpartgroup group-money-starburst :id 64 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 238))) +(defpartgroup group-money-starburst + :id 64 + :bounds (static-bspherem 0 0.5 0 1.5) + :parts ((sp-item 238))) (defpartgroup group-buzzer-effect :id 65 :bounds (static-bspherem 0 0 0 1) - :parts ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d))) - ) + :parts ((sp-item 239 :flags (is-3d)) (sp-item 240 :flags (is-3d)))) (defpart 239 - :init-specs ((:texture (new 'static 'texture-id :index #x1a :page #x2)) - (:num 2.0) - (:scale-x (meters 1.3) (meters 0.2)) - (:rot-x (degrees 0) (degrees 70)) - (:rot-y (degrees 0)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 128.0) - (:b 128.0) - (:a 32.0) - (:fade-a -1.0) - (:timer (seconds 0.035)) - (:flags (bit2 bit3 bit12 bit14)) - (:launchrot-x (degrees -180) (degrees 360)) - (:launchrot-y (degrees -180) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1a :page #x2)) (:num 2.0) + (:scale-x (meters 1.3) (meters 0.2)) + (:rot-x (degrees 0) (degrees 70)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:fade-a -1.0) + (:timer (seconds 0.035)) + (:flags (bit2 bit3 bit12 bit14)) + (:launchrot-x (degrees -180) (degrees 360)) + (:launchrot-y (degrees -180) (degrees 360)))) (defpart 240 - :init-specs ((:texture (new 'static 'texture-id :index #x1a :page #x2)) - (:num 2.0) - (:scale-x (meters 1.3) (meters 0.2)) - (:rot-x (degrees 110) (degrees 70)) - (:rot-y (degrees 0)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 128.0) - (:b 128.0) - (:a 32.0) - (:fade-a -1.0) - (:timer (seconds 0.035)) - (:flags (bit2 bit3 bit12 bit14)) - (:launchrot-x (degrees -180) (degrees 360)) - (:launchrot-y (degrees -180) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x1a :page #x2)) (:num 2.0) + (:scale-x (meters 1.3) (meters 0.2)) + (:rot-x (degrees 110) (degrees 70)) + (:rot-y (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:fade-a -1.0) + (:timer (seconds 0.035)) + (:flags (bit2 bit3 bit12 bit14)) + (:launchrot-x (degrees -180) (degrees 360)) + (:launchrot-y (degrees -180) (degrees 360)))) (defpartgroup group-green-collect :id 66 @@ -2130,75 +1899,68 @@ :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 241) (sp-item 242) (sp-item 243)) - ) + :parts ((sp-item 241) (sp-item 242) (sp-item 243))) (defpart 241 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 16.0) - (:scale-x (meters 6) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5) (meters 1)) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 242 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 6.0) - (:scale-x (meters 8) (meters 2)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5)) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 243 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 6)) - (:rot-z (degrees 0)) - (:scale-y :copy scale-x) - (:r 32.0 92.0) - (:g 128.0 128.0) - (:b 0.0) - (:a 128.0) - (:scalevel-x (meters 0.1)) - (:rotvel-z (degrees -0.8)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.42666668) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.2)) - (:next-launcher 245) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 245))) (defpartgroup group-blue-collect :id 67 @@ -2206,75 +1968,68 @@ :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 246) (sp-item 247) (sp-item 248)) - ) + :parts ((sp-item 246) (sp-item 247) (sp-item 248))) (defpart 246 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 16.0) - (:scale-x (meters 6) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5) (meters 1)) - (:r 32.0 32.0) - (:g 60.0 20.0) - (:b 128.0 64.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 247 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 6.0) - (:scale-x (meters 8) (meters 2)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5)) - (:r 32.0 32.0) - (:g 60.0 20.0) - (:b 128.0 64.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 248 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 6)) - (:rot-z (degrees 0)) - (:scale-y :copy scale-x) - (:r 32.0 32.0) - (:g 60.0 20.0) - (:b 128.0 64.0) - (:a 128.0) - (:scalevel-x (meters 0.1)) - (:rotvel-z (degrees -0.8)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.42666668) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.2)) - (:next-launcher 245) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 245))) (defpartgroup group-yellow-collect :id 68 @@ -2282,83 +2037,74 @@ :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) - :parts ((sp-item 249) (sp-item 250) (sp-item 251)) - ) + :parts ((sp-item 249) (sp-item 250) (sp-item 251))) (defpart 249 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 16.0) - (:scale-x (meters 6) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5) (meters 1)) - (:r 128.0 128.0) - (:g 64.0 192.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 244 - :init-specs ((:fade-a -0.15238096)) - ) + :init-specs ((:fade-a -0.15238096))) (defpart 250 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 6.0) - (:scale-x (meters 8) (meters 2)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5)) - (:r 128.0 128.0) - (:g 64.0 192.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 251 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 6)) - (:rot-z (degrees 0)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 64.0 192.0) - (:b 0.0) - (:a 128.0) - (:scalevel-x (meters 0.1)) - (:rotvel-z (degrees -0.8)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.42666668) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.2)) - (:next-launcher 245) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 245))) (defpart 245 - :init-specs ((:scalevel-x (meters -0.025)) (:scalevel-y :copy scalevel-x)) - ) + :init-specs ((:scalevel-x (meters -0.025)) (:scalevel-y :copy scalevel-x))) (defpartgroup group-red-collect :id 69 @@ -2366,72 +2112,65 @@ :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 252) (sp-item 253) (sp-item 254)) - ) + :parts ((sp-item 252) (sp-item 253) (sp-item 254))) (defpart 252 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 16.0) - (:scale-x (meters 6) (meters 1)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5) (meters 1)) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 253 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 6.0) - (:scale-x (meters 8) (meters 2)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.5)) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:fade-a 2.1333334) - (:timer (seconds 1.5)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.017) (seconds 0.065)) - (:next-launcher 244) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 244))) (defpart 254 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 6)) - (:rot-z (degrees 0)) - (:scale-y :copy scale-x) - (:r 128.0 128.0) - (:g 0.0 64.0) - (:b 0.0) - (:a 128.0) - (:scalevel-x (meters 0.1)) - (:rotvel-z (degrees -0.8)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.42666668) - (:timer (seconds 1)) - (:flags (bit2 bit3 bit14)) - (:func 'sparticle-track-root) - (:next-time (seconds 0.2)) - (:next-launcher 245) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (bit2 bit3 bit14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 245))) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 9740cca0f0..45fc44d9d1 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/common-obs/generic-obs.gc") (require "engine/physics/trajectory.gc") (require "engine/collide/collide-cache.gc") @@ -14,6 +13,7 @@ ;; dgos: GAME, ENGINE (declare-type vent process-drawable) + (declare-type eco eco-collectable) (defenum collectable-flags @@ -25,65 +25,51 @@ (fading 3) (suck 4) (ignore-blue 5) - (anim 6) - ) + (anim 6)) ;; DECOMP BEGINS (define *eco-pill-count* 0) (deftype collectable (process-drawable) - ((root collide-shape-moving :override) - (pickup-type pickup-type) - (pickup-amount float) - (notify-parent basic) - (old-base vector :inline) - (base vector :inline) - (extra-trans vector :inline) - (jump-pos vector :inline) - (flags collectable-flags) - (birth-time time-frame) - (collect-timeout time-frame) - (fadeout-timeout time-frame) - (bob-offset int64) - (bob-amount float) - (pickup-handle handle) - (actor-pause symbol) - ) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify-parent basic) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flags) + (birth-time time-frame) + (collect-timeout time-frame) + (fadeout-timeout time-frame) + (bob-offset int64) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol)) (:methods - (initialize (_type_) _type_) - (initialize-params (_type_ time-frame float) none) - ) - ) - + (initialize (_type_) _type_) + (initialize-params (_type_ time-frame float) none))) (defmethod initialize-params ((this collectable) (arg0 time-frame) (arg1 float)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask collectable)) (set! (-> this flags) (collectable-flags can-collect ignore-blue)) (set! (-> this bob-amount) arg1) - (set! (-> this bob-offset) (+ (the-as int (-> this root trans x)) - (the-as int (-> this root trans y)) - (the-as int (-> this root trans z)) - ) - ) + (set! (-> this bob-offset) + (+ (the-as int (-> this root trans x)) (the-as int (-> this root trans y)) (the-as int (-> this root trans z)))) (cond - ((or (= (vector-length (-> this root transv)) 0.0) - (logtest? (-> this fact options) (fact-options instant-collect)) - ) - (vector-reset! (-> this root transv)) - ) + ((or (= (vector-length (-> this root transv)) 0.0) (logtest? (-> this fact options) (fact-options instant-collect))) + (vector-reset! (-> this root transv))) (else - (logior! (-> this flags) (collectable-flags trans)) - (logclear! (-> this flags) (collectable-flags can-collect)) - (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this bob-amount) 0.0) - ) - ) + (logior! (-> this flags) (collectable-flags trans)) + (logclear! (-> this flags) (collectable-flags can-collect)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0))) (when (and (> arg0 0) #t) (logior! (-> this flags) (collectable-flags fade)) - (set! (-> this fadeout-timeout) arg0) - ) + (set! (-> this fadeout-timeout) arg0)) (set! (-> this collect-timeout) (seconds 0.33)) (set-time! (-> this birth-time)) (set! (-> this base quad) (-> this root trans quad)) @@ -91,43 +77,34 @@ (set! (-> this pickup-handle) (the-as handle #f)) (case (-> this fact pickup-type) (((pickup-type eco-pill) (pickup-type eco-green) (pickup-type money) (pickup-type eco-blue)) - (logclear! (-> this flags) (collectable-flags ignore-blue)) - ) - ) + (logclear! (-> this flags) (collectable-flags ignore-blue)))) (if (logtest? (-> this fact options) (fact-options large)) - (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) - ) - (none) - ) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w)))) + (none)) (deftype eco-collectable (collectable) - ((eco-effect sparticle-launch-group) - (collect-effect sparticle-launch-group) - (collect-effect2 sparticle-launch-group) - (collect-effect-time time-frame) - (respawn-delay time-frame) - (sound-name sound-spec) - (target handle) - (suck-time time-frame) - (suck-y-offset float) - (speed vector :inline) - (movie-pos-index int32) - ) + ((eco-effect sparticle-launch-group) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (respawn-delay time-frame) + (sound-name sound-spec) + (target handle) + (suck-time time-frame) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32)) (:state-methods - wait - (pickup object handle) - die - jump - (notice-blue handle) - ) + wait + (pickup object handle) + die + jump + (notice-blue handle)) (:methods - (initialize-effect (_type_ pickup-type) none) - (initialize-eco (_type_ entity-actor pickup-type float) object) - (animate (_type_) none) - (blocked () _type_ :state) - ) - ) - + (initialize-effect (_type_ pickup-type) none) + (initialize-eco (_type_ entity-actor pickup-type float) object) + (animate (_type_) none) + (blocked () _type_ :state))) (defmethod initialize ((this eco-collectable)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 @@ -137,33 +114,24 @@ (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind powerup blue-eco-suck)) (set! (-> s4-0 collide-with) (collide-kind target)) (set-vector! (-> s4-0 local-sphere) 0.0 3276.8 0.0 3276.8) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) - (if (logtest? (fact-options respawn) (-> this fact options)) - (set! (-> this respawn-delay) (-> this fact fade-time)) - ) - this - ) + (if (logtest? (fact-options respawn) (-> this fact options)) (set! (-> this respawn-delay) (-> this fact fade-time))) + this) (defmethod initialize-effect ((this eco-collectable) (arg0 pickup-type)) (set! (-> this fact pickup-type) arg0) (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow)) - (logclear! (-> this mask) (process-mask actor-pause)) - ) - ) + (logclear! (-> this mask) (process-mask actor-pause)))) (set! (-> this sound-name) #f) (case arg0 (((pickup-type eco-yellow)) @@ -171,52 +139,41 @@ (set! (-> this collect-effect) (-> *part-group-id-table* 68)) (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) (set! (-> this collect-effect-time) (seconds 0.5)) - (set! (-> this sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) - ) + (set! (-> this sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15))) (((pickup-type eco-red)) (set! (-> this eco-effect) (-> *part-group-id-table* 48)) (set! (-> this collect-effect) (-> *part-group-id-table* 69)) (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) (set! (-> this collect-effect-time) (seconds 0.5)) - (set! (-> this sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) - ) + (set! (-> this sound-name) (static-sound-spec "red-eco-idle" :fo-max 15))) (((pickup-type eco-blue)) (set! (-> this eco-effect) (-> *part-group-id-table* 42)) (set! (-> this collect-effect) (-> *part-group-id-table* 67)) (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) (set! (-> this collect-effect-time) (seconds 0.5)) - (set! (-> this sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) - ) + (set! (-> this sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15))) (((pickup-type eco-green)) (set! (-> this eco-effect) (-> *part-group-id-table* 58)) (set! (-> this collect-effect) (-> *part-group-id-table* 66)) (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) (set! (-> this collect-effect-time) (seconds 0.5)) - (set! (-> this sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) - ) + (set! (-> this sound-name) (static-sound-spec "green-eco-idle" :fo-max 15))) (((pickup-type eco-pill)) (set! (-> this eco-effect) (-> *part-group-id-table* 59)) (set! (-> this collect-effect2) (-> *part-group-id-table* 60)) - (set! (-> this collect-effect-time) (seconds 0.5)) - ) - ) + (set! (-> this collect-effect-time) (seconds 0.5)))) (set! (-> this part) (create-launch-control (-> this eco-effect) this)) - (if (-> this sound-name) - (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root trans))) - ) - (none) - ) + (if (-> this sound-name) (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root trans)))) + (none)) (defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info)) (let ((s3-0 (-> arg2 pickup-type)) - (f30-0 (-> arg2 pickup-spawn-amount)) - ) + (f30-0 (-> arg2 pickup-spawn-amount))) (set! (-> self pickup-amount) f30-0) (set! (-> self pickup-type) s3-0) (initialize self) (set! (-> self fact pickup-type) s3-0) - (set! (-> self fact pickup-amount) f30-0) - ) + (set! (-> self fact pickup-amount) f30-0)) (set! (-> self fact options) (-> arg2 options)) (set! (-> self root trans quad) (-> arg0 quad)) (set! (-> self root transv quad) (-> arg1 quad)) @@ -224,28 +181,15 @@ (set! (-> self notify-parent) #f) (case (-> self fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red)) - (initialize-params - self - (the-as time-frame (if (and arg2 (logtest? (-> arg2 options) (fact-options fade))) - (the-as int (-> arg2 fade-time)) - 0 - ) - ) - (the-as float 1024.0) - ) - ) - (else - (initialize-params self (seconds 15) (the-as float 1024.0)) - ) - ) + (initialize-params self + (the-as time-frame (if (and arg2 (logtest? (-> arg2 options) (fact-options fade))) (the-as int (-> arg2 fade-time)) 0)) + (the-as float 1024.0))) + (else (initialize-params self (seconds 15) (the-as float 1024.0)))) (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) - (if (logtest? (fact-options eco-blocked) (-> self fact options)) - (go-virtual blocked) - ) + (if (logtest? (fact-options eco-blocked) (-> self fact options)) (go-virtual blocked)) (go-virtual wait) - (none) - ) + (none)) (defmethod initialize-eco ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) @@ -255,103 +199,57 @@ (initialize-effect this (-> this fact pickup-type)) (initialize-params this 0 (the-as float 1024.0)) (update-transforms! (-> this root)) - (if (logtest? (fact-options eco-blocked) (-> this fact options)) - (go (method-of-object this blocked)) - ) - (go (method-of-object this wait)) - ) + (if (logtest? (fact-options eco-blocked) (-> this fact options)) (go (method-of-object this blocked))) + (go (method-of-object this wait))) (defmethod animate ((this eco-collectable)) 0 - (none) - ) + (none)) (defun add-blue-shake ((arg0 vector) (arg1 vector) (arg2 vector)) (let* ((f0-0 (vector-vector-distance arg1 arg2)) - (f30-0 (lerp-scale - (the-as float 409.6) - (the-as float 0.0) - f0-0 - (-> *FACT-bank* suck-suck-dist) - (-> *FACT-bank* suck-bounce-dist) - ) - ) - ) + (f30-0 (lerp-scale (the-as float 409.6) + (the-as float 0.0) + f0-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist)))) (+! (-> arg0 x) (rand-vu-float-range (- f30-0) f30-0)) (+! (-> arg0 y) (rand-vu-float-range (- f30-0) f30-0)) - (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0)) - ) - arg0 - ) + (+! (-> arg0 z) (rand-vu-float-range (- f30-0) f30-0))) + arg0) (defbehavior check-blue-suck eco-collectable ((arg0 process-drawable)) - (let ((v1-1 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) - arg0 - ) - ) - ) + (let ((v1-1 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) arg0))) (when v1-1 (let* ((gp-1 (-> v1-1 root)) - (v1-3 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) - gp-1 - ) - ) - ) + (v1-3 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) (when v1-3 (let ((a0-5 (-> self root root-prim prim-core)) - (a1-2 (-> (the-as collide-shape v1-3) root-prim prim-core)) - ) + (a1-2 (-> (the-as collide-shape v1-3) root-prim prim-core))) (if (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) - (logior! (-> self flags) (collectable-flags suck)) - ) - ) - ) - ) - ) - ) - (none) - ) + (logior! (-> self flags) (collectable-flags suck)))))))) + (none)) (defbehavior add-blue-motion eco-collectable ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol)) (let* ((gp-0 (handle->process (-> self target))) - (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - ) + (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) (when v1-4 (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) - (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) - (the-as collide-shape gp-1) - ) - ) - ) + (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) (the-as collide-shape gp-1)))) (when v1-6 (let ((s2-0 (-> self root root-prim prim-core)) - (gp-2 (-> v1-6 root-prim prim-core)) - ) - (if (and arg1 (rand-vu-percent? (the-as float 0.25))) - (eco-blue-glow (the-as vector s2-0)) - ) + (gp-2 (-> v1-6 root-prim prim-core))) + (if (and arg1 (rand-vu-percent? (the-as float 0.25))) (eco-blue-glow (the-as vector s2-0))) (let ((f0-0 (vector-vector-distance (the-as vector s2-0) (the-as vector gp-2)))) (cond - ((and arg3 (< f0-0 8192.0)) - (return #t) - ) + ((and arg3 (< f0-0 8192.0)) (return #t)) ((begin (set! arg0 - (and (or (not arg2) - (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flags suck))) - ) - arg0 - ) - ) - arg0 - ) + (and (or (not arg2) (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flags suck)))) + arg0)) + arg0) (logior! (-> self flags) (collectable-flags suck)) - (if (= (-> self speed w) 0.0) - (set-time! (-> self suck-time)) - ) + (if (= (-> self speed w) 0.0) (set-time! (-> self suck-time))) (+! (-> self speed w) (* 163840.0 (seconds-per-frame))) (+! (-> self speed y) (* 291271.12 (seconds-per-frame))) (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) @@ -359,633 +257,373 @@ (vector-normalize! s5-2 (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame))))) (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame))) (set! (-> self suck-y-offset) - (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75))))) - ) - (vector+! (-> self base) (the-as vector gp-2) s5-2) - ) - ) - ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) - (not (logtest? (-> self flags) (collectable-flags suck))) - ) - ) - (go-virtual wait) - ) - (arg1 - (add-blue-shake (-> self root trans) (the-as vector s2-0) (the-as vector gp-2)) - ) - ) - ) - ) - ) - ) - ) - ) - #f - ) + (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75)))))) + (vector+! (-> self base) (the-as vector gp-2) s5-2))) + ((and arg2 + (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) (not (logtest? (-> self flags) (collectable-flags suck))))) + (go-virtual wait)) + (arg1 (add-blue-shake (-> self root trans) (the-as vector s2-0) (the-as vector gp-2)))))))))) + #f) (defstate blocked (eco-collectable) :virtual #t - :trans (behavior () - (if (task-complete? *game-info* (-> self entity extra perm task)) - (go-virtual wait) - ) - ) - :code anim-loop - ) + :trans + (behavior () + (if (task-complete? *game-info* (-> self entity extra perm task)) (go-virtual wait))) + :code anim-loop) (defstate jump (eco-collectable) :virtual #t - :code (behavior () - (if (type-type? (-> self type) fuel-cell) - (sound-play "cell-prize") - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (let ((gp-1 (new 'stack 'trajectory))) - (set! (-> self base y) (-> self jump-pos y)) - (setup-from-to-duration! - gp-1 - (-> self root trans) - (-> self jump-pos) - (the-as float 300.0) - (the-as float -2.2755556) - ) - (set-time! (-> self state-time)) - (until (time-elapsed? (-> self state-time) (seconds 1)) - (let ((f0-2 (the float (- (current-time) (-> self state-time))))) - (eval-position! gp-1 f0-2 (-> self root trans)) - ) - (transform-post) - (animate self) - (suspend) - (if (nonzero? (-> self skel)) - (ja :num! (loop! 0.5)) - ) - ) - ) - (set! (-> self root trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root trans quad)) - (vector-reset! (-> self root transv)) - (update-transforms! (-> self root)) - (logclear! (-> self flags) (collectable-flags trans)) - (logior! (-> self flags) (collectable-flags can-collect)) - (if (-> self actor-pause) - (logior! (-> self mask) (process-mask actor-pause)) - ) - (go-virtual wait) - ) - ) + :code + (behavior () + (if (type-type? (-> self type) fuel-cell) (sound-play "cell-prize")) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-1 (new 'stack 'trajectory))) + (set! (-> self base y) (-> self jump-pos y)) + (setup-from-to-duration! gp-1 (-> self root trans) (-> self jump-pos) (the-as float 300.0) (the-as float -2.2755556)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (eval-position! gp-1 f0-2 (-> self root trans))) + (transform-post) + (animate self) + (suspend) + (if (nonzero? (-> self skel)) (ja :num! (loop! 0.5))))) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) + (vector-reset! (-> self root transv)) + (update-transforms! (-> self root)) + (logclear! (-> self flags) (collectable-flags trans)) + (logior! (-> self flags) (collectable-flags can-collect)) + (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause))) + (go-virtual wait))) (defstate wait (eco-collectable) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (local-vars (v0-3 object)) - (when (and (or (= message 'touch) (= message 'attack)) - (and (logtest? (-> self flags) (collectable-flags can-collect)) - (time-elapsed? (-> self birth-time) (-> self collect-timeout)) - (!= (-> self next-state name) 'pickup) - (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle proc)) - ) - (cond - ((= message 'eco-blue) - (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) - (!= (-> self next-state name) 'pickup) - (begin (check-blue-suck (the-as process-drawable proc)) #t) - (logtest? (-> self flags) (collectable-flags can-collect)) - (time-elapsed? (-> self birth-time) (-> self collect-timeout)) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual notice-blue (process->handle proc)) - ) - ) - ((= message 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) - (update-transforms! (-> self root)) - (ja-post) - ) - ((= message 'jump) - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> block param 0)) quad)) - (go-virtual jump) - ) - ((= message 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root) (the-as vector (-> block param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (the-as handle #f)) - ) - ) - ((= message 'die) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual die) - ) - ((= message 'movie-pos) - (set! v0-3 (-> block param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 - ) - ((= message 'actor-pause) - (cond - ((-> block param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (set! v0-3 #t) - (set! (-> self actor-pause) (the-as symbol v0-3)) - v0-3 - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - ((= message 'fade) - (logior! (-> self flags) (collectable-flags fade)) - (set! (-> self fadeout-timeout) (seconds 0.1)) - (set! v0-3 (current-time)) - (set! (-> self birth-time) (the-as time-frame v0-3)) - v0-3 - ) - ) - ) - :enter (behavior () - (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) - (logtest? (-> self flags) (collectable-flags can-collect)) - (!= (-> self next-state name) 'pickup) - (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - (go-virtual pickup #f (process->handle *target*)) - ) - ) - :trans (behavior () - (cond - ((logtest? (-> self flags) (collectable-flags trans)) - (vector-v++! - (-> self root transv) - (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) (the-as float 0.0)) - ) - (integrate-no-collide! (-> self root) (-> self root transv)) - (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) - (set! (-> self root trans y) (-> self base y)) - (cond - ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) - ) - (else - (vector-reset! (-> self root transv)) - (logclear! (-> self flags) (collectable-flags trans)) - (logior! (-> self flags) (collectable-flags can-collect)) - (if (-> self actor-pause) - (logior! (-> self mask) (process-mask actor-pause)) - ) - (set! (-> self base quad) (-> self root trans quad)) - (if (and (logtest? (-> self fact options) (fact-options can-collect)) - (not (logtest? (-> self flags) (collectable-flags ignore-blue))) - ) - (go-virtual notice-blue (process->handle *target*)) - ) - (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-3 object)) + (when (and (or (= message 'touch) (= message 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) - (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - (go-virtual pickup #f (process->handle *target*)) - ) - ) - ) - ) - ) - (else - (set! (-> self trans-hook) #f) - ) - ) - (update-transforms! (-> self root)) - ) - :code (behavior () - (loop - (let ((gp-0 (-> self part)) - (s5-0 (-> self root root-prim prim-core)) - ) - (when (and (logtest? (-> self flags) (collectable-flags fade)) - (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) - ) - (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) - (cond - ((< v1-10 0) - (process-entity-status! self (entity-perm-status dead) #t) - (deactivate self) - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - (logior! (-> self flags) (collectable-flags fading)) - (logior! (-> self state-flags) (state-flags fade-out-particles)) - (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))) - ) - ) - ) - ) - (spawn gp-0 (the-as vector s5-0)) - ) - (if (nonzero? (-> self sound)) - (update! (-> self sound)) - ) - (suspend) - ) - ) - ) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc))) + (cond + ((= message 'eco-blue) + (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) + (!= (-> self next-state name) 'pickup) + (begin + (check-blue-suck (the-as process-drawable proc)) + #t) + (logtest? (-> self flags) (collectable-flags can-collect)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual notice-blue (process->handle proc)))) + ((= message 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (update-transforms! (-> self root)) + (ja-post)) + ((= message 'jump) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self jump-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (go-virtual jump)) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) (move-to-point! (-> self root) (the-as vector (-> block param 0)))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (the-as handle #f)))) + ((= message 'die) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual die)) + ((= message 'movie-pos) (set! v0-3 (-> block param 0)) (set! (-> self movie-pos-index) (the-as int v0-3)) v0-3) + ((= message 'actor-pause) + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (set! v0-3 #t) + (set! (-> self actor-pause) (the-as symbol v0-3)) + v0-3) + (else (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) #f))) + ((= message 'fade) + (logior! (-> self flags) (collectable-flags fade)) + (set! (-> self fadeout-timeout) (seconds 0.1)) + (set! v0-3 (current-time)) + (set! (-> self birth-time) (the-as time-frame v0-3)) + v0-3))) + :enter + (behavior () + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) + (logtest? (-> self flags) (collectable-flags can-collect)) + (!= (-> self next-state name) 'pickup) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount))) + (go-virtual pickup #f (process->handle *target*)))) + :trans + (behavior () + (cond + ((logtest? (-> self flags) (collectable-flags trans)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) (the-as float 0.0))) + (integrate-no-collide! (-> self root) (-> self root transv)) + (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) + (set! (-> self root trans y) (-> self base y)) + (cond + ((< (-> self root transv y) -8192.0) (set! (-> self root transv y) (* -0.5 (-> self root transv y)))) + (else + (vector-reset! (-> self root transv)) + (logclear! (-> self flags) (collectable-flags trans)) + (logior! (-> self flags) (collectable-flags can-collect)) + (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause))) + (set! (-> self base quad) (-> self root trans quad)) + (if (and (logtest? (-> self fact options) (fact-options can-collect)) + (not (logtest? (-> self flags) (collectable-flags ignore-blue)))) + (go-virtual notice-blue (process->handle *target*))) + (if (and (logtest? (-> self fact options) (fact-options instant-collect can-collect)) + (!= (-> self next-state name) 'pickup) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount))) + (go-virtual pickup #f (process->handle *target*))))))) + (else (set! (-> self trans-hook) #f))) + (update-transforms! (-> self root))) + :code + (behavior () + (loop (let ((gp-0 (-> self part)) + (s5-0 (-> self root root-prim prim-core))) + (when (and (logtest? (-> self flags) (collectable-flags fade)) (time-elapsed? (-> self birth-time) (-> self fadeout-timeout))) + (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) + (cond + ((< v1-10 0) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self)) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flags fading)) + (logior! (-> self state-flags) (state-flags fade-out-particles)) + (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))))))) + (spawn gp-0 (the-as vector s5-0))) + (if (nonzero? (-> self sound)) (update! (-> self sound))) + (suspend)))) (defstate notice-blue (eco-collectable) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (when (and (or (= message 'touch) (= message 'attack)) - (and (logtest? (-> self flags) (collectable-flags can-collect)) - (time-elapsed? (-> self birth-time) (-> self collect-timeout)) - (!= (-> self next-state name) 'pickup) - (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle proc)) - ) - ) - :enter (behavior ((arg0 handle)) - (set! (-> self target) arg0) - (set! (-> self speed quad) (the-as uint128 0)) - (set! (-> self speed z) (the-as float (if (rand-vu-percent? (the-as float 0.5)) - 1.0 - -1.0 - ) - ) - ) - (set! (-> self suck-y-offset) 0.0) - (logclear! (-> self mask) (process-mask actor-pause)) - ) - :exit (behavior () - (if (-> self actor-pause) - (logior! (-> self mask) (process-mask actor-pause)) - ) - ) - :trans (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'powerup)) - (set! (-> a1-0 param 1) (the-as uint 3)) - (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flags suck)))) - (go-virtual wait) - ) - ) - ) - :code (behavior ((arg0 handle)) - (loop - (set! (-> self root trans quad) (-> self base quad)) - (add-blue-motion #t #f #t #f) - (update-transforms! (-> self root)) - (if (nonzero? (-> self draw)) - (ja-post) - ) - (let ((a0-5 (-> self part)) - (a1-1 (-> self root root-prim prim-core)) - ) - (if (nonzero? a0-5) - (spawn a0-5 (the-as vector a1-1)) - ) - ) - (if (nonzero? (-> self sound)) - (update! (-> self sound)) - ) - (suspend) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (when (and (or (= message 'touch) (= message 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + (!= (-> self next-state name) 'pickup) + (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc)))) + :enter + (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (set! (-> self speed quad) (the-as uint128 0)) + (set! (-> self speed z) (the-as float (if (rand-vu-percent? (the-as float 0.5)) 1.0 -1.0))) + (set! (-> self suck-y-offset) 0.0) + (logclear! (-> self mask) (process-mask actor-pause))) + :exit + (behavior () + (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)))) + :trans + (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'powerup)) + (set! (-> a1-0 param 1) (the-as uint 3)) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flags suck)))) + (go-virtual wait)))) + :code + (behavior ((arg0 handle)) + (loop (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #f #t #f) + (update-transforms! (-> self root)) + (if (nonzero? (-> self draw)) (ja-post)) + (let ((a0-5 (-> self part)) + (a1-1 (-> self root root-prim prim-core))) + (if (nonzero? a0-5) (spawn a0-5 (the-as vector a1-1)))) + (if (nonzero? (-> self sound)) (update! (-> self sound))) + (suspend)))) (defstate pickup (eco-collectable) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (the-as - symbol - (case message - (('set-movie-pos) - (let ((v1-3 (res-lump-struct (-> self entity) 'movie-pos vector :time (the-as float -1000000000.0)))) - (the-as symbol (when v1-3 - (set! (-> v1-3 quad) (-> (the-as vector (-> block param 0)) quad)) - (the-as symbol v1-3) - ) - ) - ) - ) - (('actor-pause) - (the-as symbol (cond - ((-> block param 0) - (logior! (-> self mask) (process-mask actor-pause)) - (let ((v0-1 #t)) - (set! (-> self actor-pause) v0-1) - v0-1 - ) - ) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - #f - ) - ) - ) - ) - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (the-as symbol (deactivate self)) - ) - ) - ) - ) - :enter (behavior ((arg0 object) (arg1 handle)) - (set! (-> self pickup-handle) arg1) - (when (-> self notify-parent) - (let ((gp-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> gp-0 from) self) - (set! (-> gp-0 num-params) 1) - (set! (-> gp-0 message) 'notify) - (set! (-> gp-0 param 0) (the-as uint 'pickup)) - (let ((s5-0 send-event-function) - (s4-0 (ppointer->process (-> self parent))) - ) - (s5-0 - (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process)) - s4-0 - ) - gp-0 - ) - ) - ) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - ) - :code (behavior ((arg0 object) (arg1 handle)) - (clear-collide-with-as (-> self root)) - (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) - (logtest? (-> self fact options) (fact-options powerup)) - ) - ) - (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - (if (nonzero? (-> self sound)) - (stop! (-> self sound)) - ) - (case (-> self fact pickup-type) - (((pickup-type eco-yellow)) - (sound-play "y-eco-pickup") - ) - (((pickup-type eco-red)) - (sound-play "r-eco-pickup") - ) - (((pickup-type eco-blue)) - (sound-play "b-eco-pickup") - (case (-> (level-get-target-inside *level*) name) - (('training) - (level-hint-spawn - (text-id training-eco-reminder) - "sagevb23" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - ) - (((pickup-type eco-green)) - (sound-play "g-eco-pickup") - ) - (((pickup-type eco-green) (pickup-type eco-pill)) - (sound-play "pill-pickup") - ) - ) - (if (nonzero? (-> self part)) - (kill-and-free-particles (-> self part)) - ) - (let ((gp-6 (handle->process (-> self pickup-handle)))) - (if (nonzero? (-> self collect-effect)) - (process-spawn - part-tracker - :init part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> self root root-prim prim-core) - :to gp-6 - ) - ) - ) - (if (nonzero? (-> self collect-effect2)) - (process-spawn - part-tracker - :init part-tracker-init - (-> self collect-effect2) - -1 - (lambda ((arg0 part-tracker)) - (let ((s5-0 (handle->process (-> arg0 userdata)))) - (when s5-0 - (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) - (a2-0 (cond - ((not v1-4) - (-> arg0 root trans) - ) - ((= (-> v1-4 type) target) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5)) - ) - (else - (-> (the-as target v1-4) control trans) - ) - ) - ) - ) - (vector-lerp! - (-> arg0 root trans) - (-> arg0 offset) - a2-0 - (/ (the float (- (current-time) (-> arg0 start-time))) - (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) - ) - ) - ) - ) - ) - ) - (process->handle self) - #f - (-> self root root-prim prim-core) - :to self - ) - ) - (while (-> self child) - (suspend) - ) - (go-virtual die) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (the-as symbol + (case message + (('set-movie-pos) + (let ((v1-3 (res-lump-struct (-> self entity) 'movie-pos vector :time (the-as float -1000000000.0)))) + (the-as symbol (when v1-3 (set! (-> v1-3 quad) (-> (the-as vector (-> block param 0)) quad)) (the-as symbol v1-3))))) + (('actor-pause) + (the-as symbol + (cond + ((-> block param 0) + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v0-1 #t)) (set! (-> self actor-pause) v0-1) v0-1)) + (else (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) #f)))) + (('fade) (process-entity-status! self (entity-perm-status dead) #t) (the-as symbol (deactivate self)))))) + :enter + (behavior ((arg0 object) (arg1 handle)) + (set! (-> self pickup-handle) arg1) + (when (-> self notify-parent) + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) self) + (set! (-> gp-0 num-params) 1) + (set! (-> gp-0 message) 'notify) + (set! (-> gp-0 param 0) (the-as uint 'pickup)) + (let ((s5-0 send-event-function) + (s4-0 (ppointer->process (-> self parent)))) + (s5-0 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process)) s4-0) gp-0)))) + (logclear! (-> self mask) (process-mask actor-pause))) + :code + (behavior ((arg0 object) (arg1 handle)) + (clear-collide-with-as (-> self root)) + (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)))) + (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount))) + (if (nonzero? (-> self sound)) (stop! (-> self sound))) + (case (-> self fact pickup-type) + (((pickup-type eco-yellow)) (sound-play "y-eco-pickup")) + (((pickup-type eco-red)) (sound-play "r-eco-pickup")) + (((pickup-type eco-blue)) + (sound-play "b-eco-pickup") + (case (-> (level-get-target-inside *level*) name) + (('training) + (level-hint-spawn (text-id training-eco-reminder) "sagevb23" (the-as entity #f) *entity-pool* (game-task none))))) + (((pickup-type eco-green)) (sound-play "g-eco-pickup")) + (((pickup-type eco-green) (pickup-type eco-pill)) (sound-play "pill-pickup"))) + (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part))) + (let ((gp-6 (handle->process (-> self pickup-handle)))) + (if (nonzero? (-> self collect-effect)) + (process-spawn part-tracker + :init + part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> self root root-prim prim-core) + :to + gp-6))) + (if (nonzero? (-> self collect-effect2)) + (process-spawn part-tracker + :init + part-tracker-init + (-> self collect-effect2) + -1 + (lambda ((arg0 part-tracker)) + (let ((s5-0 (handle->process (-> arg0 userdata)))) + (when s5-0 + (let* ((v1-4 (handle->process (-> (the-as eco-collectable s5-0) pickup-handle))) + (a2-0 (cond + ((not v1-4) (-> arg0 root trans)) + ((= (-> v1-4 type) target) (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as target v1-4) node-list data 5))) + (else (-> (the-as target v1-4) control trans))))) + (vector-lerp! (-> arg0 root trans) + (-> arg0 offset) + a2-0 + (/ (the float (- (current-time) (-> arg0 start-time))) + (the float (-> (the-as eco-collectable s5-0) collect-effect-time)))))))) + (process->handle self) + #f + (-> self root root-prim prim-core) + :to + self)) + (while (-> self child) + (suspend)) + (go-virtual die))) (defstate die (eco-collectable) :virtual #t - :code (behavior () - (process-entity-status! self (entity-perm-status dead) #t) - ) - ) - -(deftype eco (eco-collectable) - () - ) + :code + (behavior () + (process-entity-status! self (entity-perm-status dead) #t))) +(deftype eco (eco-collectable) ()) (defmethod animate ((this eco)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root root-prim prim-core)) - ) - (spawn a0-1 (the-as vector a1-0)) - ) - (if (nonzero? (-> this sound)) - (update! (-> this sound)) - ) + (a1-0 (-> this root root-prim prim-core))) + (spawn a0-1 (the-as vector a1-0))) + (if (nonzero? (-> this sound)) (update! (-> this sound))) 0 - (none) - ) + (none)) (defstate die (eco) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('fade) - (process-entity-status! self (entity-perm-status dead) #t) - (deactivate self) - ) - (('die) - (go-virtual die) - ) - ) - ) - :exit (behavior () - (process-entity-status! self (entity-perm-status bit-3) #f) - (if (-> self actor-pause) - (logior! (-> self mask) (process-mask actor-pause)) - ) - ) - :code (behavior () - (process-entity-status! self (entity-perm-status bit-3) #t) - (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self fact options) (fact-options instant-collect can-collect)) - (if (nonzero? (-> self part)) - (kill-and-free-particles (-> self part)) - ) - (cond - ((nonzero? (-> self respawn-delay)) - (let ((gp-0 (current-time))) - (while (not (time-elapsed? gp-0 (-> self respawn-delay))) - (suspend) - ) - ) - ) - (else - (while (let ((f30-0 0.0)) - (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type)))) - ) - (suspend) - ) - ) - ) - (set! (-> self base quad) (-> self old-base quad)) - (set! (-> self root trans quad) (-> self base quad)) - (restore-collide-with-as (-> self root)) - (go-virtual wait) - ) - ) - -(deftype eco-yellow (eco) - () - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fade) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self)) + (('die) (go-virtual die)))) + :exit + (behavior () + (process-entity-status! self (entity-perm-status bit-3) #f) + (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)))) + :code + (behavior () + (process-entity-status! self (entity-perm-status bit-3) #t) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self fact options) (fact-options instant-collect can-collect)) + (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part))) + (cond + ((nonzero? (-> self respawn-delay)) + (let ((gp-0 (current-time))) (while (not (time-elapsed? gp-0 (-> self respawn-delay))) (suspend)))) + (else + (while (let ((f30-0 0.0)) (< f30-0 (the-as float (send-event *target* 'query 'pickup (-> self fact pickup-type))))) + (suspend)))) + (set! (-> self base quad) (-> self old-base quad)) + (set! (-> self root trans quad) (-> self base quad)) + (restore-collide-with-as (-> self root)) + (go-virtual wait))) +(deftype eco-yellow (eco) ()) (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) - (none) - ) - -(deftype eco-red (eco) - () - ) + (none)) +(deftype eco-red (eco) ()) (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) - (none) - ) - -(deftype eco-blue (eco) - () - ) + (none)) +(deftype eco-blue (eco) ()) (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) - (none) - ) - -(deftype health (eco-collectable) - () - ) + (none)) +(deftype health (eco-collectable) ()) (defmethod animate ((this health)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root root-prim prim-core)) - ) - (spawn a0-1 (the-as vector a1-0)) - ) - (if (nonzero? (-> this sound)) - (update! (-> this sound)) - ) + (a1-0 (-> this root root-prim prim-core))) + (spawn a0-1 (the-as vector a1-0))) + (if (nonzero? (-> this sound)) (update! (-> this sound))) 0 - (none) - ) + (none)) (defmethod init-from-entity! ((this health) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) - (none) - ) - -(deftype eco-pill (eco-collectable) - () - ) + (none)) +(deftype eco-pill (eco-collectable) ()) (defmethod animate ((this eco-pill)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root root-prim prim-core)) - ) - (spawn a0-1 (the-as vector a1-0)) - ) - (if (nonzero? (-> this sound)) - (update! (-> this sound)) - ) + (a1-0 (-> this root root-prim prim-core))) + (spawn a0-1 (the-as vector a1-0))) + (if (nonzero? (-> this sound)) (update! (-> this sound))) 0 - (none) - ) + (none)) (defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) - (none) - ) + (none)) (defmethod deactivate ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* -1)) ((method-of-type eco-collectable deactivate) this) - (none) - ) + (none)) (defmethod initialize ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* 1)) @@ -996,179 +634,128 @@ (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind powerup blue-eco-suck)) (set! (-> s4-0 collide-with) (collide-kind target)) (set-vector! (-> s4-0 local-sphere) 0.0 3276.8 0.0 8192.0) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) - this - ) + this) -(defskelgroup *money-sg* money money-lod0-jg money-idle-ja - ((money-lod0-mg (meters 20)) (money-lod1-mg (meters 40)) (money-lod2-mg (meters 999999))) - :bounds (static-spherem 0 0 0 0.6) - :texture-level 2 - ) +(defskelgroup *money-sg* + money + money-lod0-jg + money-idle-ja + ((money-lod0-mg (meters 20)) (money-lod1-mg (meters 40)) (money-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.6) + :texture-level 2) -(defskelgroup *fuel-cell-sg* fuel-cell fuel-cell-lod0-jg fuel-cell-idle-ja - ((fuel-cell-lod0-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) - -(deftype money (eco-collectable) - () - ) +(defskelgroup *fuel-cell-sg* + fuel-cell + fuel-cell-lod0-jg + fuel-cell-idle-ja + ((fuel-cell-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) +(deftype money (eco-collectable) ()) (defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) - (vector-vector-distance (-> this root trans) (math-camera-pos)) - ) - ) + (vector-vector-distance (-> this root trans) (math-camera-pos)))) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) - (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) - ) - ) - ) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update)))))) (defmethod deactivate ((this money)) (when (= (-> this next-state name) 'pickup) (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) - (format #t "money ~A was killed in pickup~%") - ) - (process-entity-status! this (entity-perm-status dead) #t) - ) + (format #t "money ~A was killed in pickup~%")) + (process-entity-status! this (entity-perm-status dead) #t)) ((method-of-type eco-collectable deactivate) this) - (none) - ) + (none)) (defstate wait (money) :virtual #t - :code (behavior () - (loop - (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) - (let ((f30-0 (-> self bob-amount))) - (when (< 0.0 f30-0) - (set! (-> self root trans y) - (+ (-> self base y) - (-> self suck-y-offset) - (* f30-0 - (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) - ) - ) - ) - (update-transforms! (-> self root)) - ) - ) - (ja-post) - ;; og:preserve-this added particle! - (with-pc - (if (-> *pc-settings* money-starburst?) - (spawn (-> self part) (-> self root root-prim world-sphere)))) - (suspend) - ) - ) - ) - -(defstate notice-blue (money) - :virtual #t - :code (behavior ((arg0 handle)) - (loop - (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) - (set! (-> self root trans quad) (-> self base quad)) - (add-blue-motion #t #t #t #f) - (let ((f30-0 (-> self bob-amount))) - (if (< 0.0 f30-0) + :code + (behavior () + (loop (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) + (let ((f30-0 (-> self bob-amount))) + (when (< 0.0 f30-0) (set! (-> self root trans y) (+ (-> self base y) (-> self suck-y-offset) - (* f30-0 - (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) - ) - ) - ) - ) - ) - (transform-post) - ;; og:preserve-this added particle! - (with-pc - (if (-> *pc-settings* money-starburst?) - (spawn (-> self part) (-> self root root-prim world-sphere)))) - (suspend) - ) - ) - ) + (* f30-0 (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600))))))) + (update-transforms! (-> self root)))) + (ja-post) + ;; og:preserve-this added particle! + (with-pc (if (-> *pc-settings* money-starburst?) (spawn (-> self part) (-> self root root-prim world-sphere)))) + (suspend)))) + +(defstate notice-blue (money) + :virtual #t + :code + (behavior ((arg0 handle)) + (loop (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (set! (-> self root trans quad) (-> self base quad)) + (add-blue-motion #t #t #t #f) + (let ((f30-0 (-> self bob-amount))) + (if (< 0.0 f30-0) + (set! (-> self root trans y) + (+ (-> self base y) + (-> self suck-y-offset) + (* f30-0 (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600))))))))) + (transform-post) + ;; og:preserve-this added particle! + (with-pc (if (-> *pc-settings* money-starburst?) (spawn (-> self part) (-> self root root-prim world-sphere)))) + (suspend)))) (defstate pickup (money) :virtual #t - :code (behavior ((arg0 object) (arg1 handle)) - ;; og:preserve-this added - (if (nonzero? (-> self part)) - (kill-and-free-particles (-> self part)) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root)) - (process-entity-status! self (entity-perm-status dead) #t) - (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))) - ) - ) + :code + (behavior ((arg0 object) (arg1 handle)) + ;; og:preserve-this added + (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part))) + (logclear! (-> self mask) (process-mask actor-pause)) + (clear-collide-with-as (-> self root)) + (process-entity-status! self (entity-perm-status dead) #t) + (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))))) (defmethod initialize ((this money)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind powerup blue-eco-suck)) (set! (-> s4-0 collide-with) (collide-kind target)) (set-vector! (-> s4-0 local-sphere) 0.0 2048.0 0.0 4915.2) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) (set! (-> this notify-parent) #f) (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) (the-as float 1.0))) (let ((a0-10 (-> this entity))) (if (when a0-10 - (let ((a0-11 (-> a0-10 extra perm task))) - (if a0-11 - (= a0-11 (game-task none)) - ) - ) - ) - (set! (-> this entity extra perm task) (game-task complete)) - ) - ) - (initialize-skeleton this *money-sg* '()) - (if (-> this entity) - (nav-mesh-connect this (-> this root) (the-as nav-control #f)) - ) + (let ((a0-11 (-> a0-10 extra perm task))) (if a0-11 (= a0-11 (game-task none))))) + (set! (-> this entity extra perm task) (game-task complete)))) + (initialize-skeleton this *money-sg* ()) + (if (-> this entity) (nav-mesh-connect this (-> this root) (the-as nav-control #f))) (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ;; og:preserve-this added money starburst (set! (-> this part) (create-launch-control (-> *part-group-id-table* 64) this)) - this - ) + this) (defmethod init-from-entity! ((this money) (arg0 entity-actor)) (initialize this) @@ -1176,20 +763,17 @@ (initialize-params this 0 (the-as float 1024.0)) (update-transforms! (-> this root)) (go (method-of-object this wait)) - (none) - ) + (none)) (defbehavior money-init-by-other money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) - (f30-0 (-> arg2 pickup-spawn-amount)) - ) + (f30-0 (-> arg2 pickup-spawn-amount))) (set! (-> self entity) arg3) (set! (-> self pickup-type) s3-0) (set! (-> self pickup-amount) f30-0) (initialize self) (set! (-> self fact pickup-type) s3-0) - (set! (-> self fact pickup-amount) f30-0) - ) + (set! (-> self fact pickup-amount) f30-0)) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) (set! (-> self root trans quad) (-> arg0 quad)) @@ -1200,8 +784,7 @@ (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) - (none) - ) + (none)) (defbehavior money-init-by-other-no-bob money ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 float) (arg4 entity-actor)) (set! (-> self entity) arg4) @@ -1220,678 +803,318 @@ (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) - (none) - ) + (none)) (define *fuel-cell-tune-pos* (new 'static 'vector :w 1000000000.0)) (deftype fuel-cell (eco-collectable) - ((victory-anim spool-anim) - (state-object symbol) - ) - (:states - (fuel-cell-clone-anim handle) - (fuel-cell-spline-slider handle float float) - ) - ) - + ((victory-anim spool-anim) + (state-object symbol)) + (:states (fuel-cell-clone-anim handle) + (fuel-cell-spline-slider handle float float))) (defun fuel-cell-pick-anim ((arg0 process-drawable)) (let* ((gp-0 (-> arg0 entity extra trans)) (a0-2 (res-lump-value (-> arg0 entity) 'movie-mask uint128 :time (the-as float -1000000000.0))) (a1-1 8) (v1-6 (abs (the int (+ (* 0.00024414062 (-> gp-0 x)) (* 0.00024414062 (-> gp-0 z)))))) - (v1-7 (mod v1-6 a1-1)) - ) + (v1-7 (mod v1-6 a1-1))) (while (logtest? a0-2 (ash 1 v1-7)) - (set! v1-7 (mod (+ v1-7 1) a1-1)) - ) + (set! v1-7 (mod (+ v1-7 1) a1-1))) (when *target* (cond - ((logtest? (-> *target* control root-prim prim-core action) (collide-action racer)) - (set! v1-7 16) - ) - ((logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (set! v1-7 32) - ) - ) - ) + ((logtest? (-> *target* control root-prim prim-core action) (collide-action racer)) (set! v1-7 16)) + ((logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) (set! v1-7 32)))) (cond - ((zero? v1-7) - (new 'static 'spool-anim :name "fuel-cell-victory" :index 3 :parts 2 :command-list '()) - ) - ((= v1-7 1) - (new 'static 'spool-anim :name "fuel-cell-victory-2" :index 4 :parts 2 :command-list '()) - ) - ((= v1-7 2) - (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list '()) - ) - ((= v1-7 3) - (new 'static 'spool-anim :name "fuel-cell-victory-4" :index 6 :parts 2 :command-list '()) - ) - ((= v1-7 4) - (new 'static 'spool-anim :name "fuel-cell-victory-5" :index 7 :parts 2 :command-list '()) - ) - ((= v1-7 5) - (new 'static 'spool-anim :name "fuel-cell-victory-6" :index 8 :parts 2 :command-list '()) - ) - ((= v1-7 6) - (new 'static 'spool-anim :name "fuel-cell-victory-7" :index 9 :parts 2 :command-list '()) - ) - ((= v1-7 7) - (new 'static 'spool-anim :name "fuel-cell-victory-8" :index 10 :parts 2 :command-list '()) - ) - ((= v1-7 16) - (new 'static 'spool-anim :name "fuel-cell-racer-victory-1" :index 40 :parts 2 :command-list '()) - ) - ((= v1-7 32) - (new 'static 'spool-anim :name "fuel-cell-flut-victory-1" :index 44 :parts 2 :command-list '()) - ) - (else - (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list '()) - ) - ) - ) - ) + ((zero? v1-7) (new 'static 'spool-anim :name "fuel-cell-victory" :index 3 :parts 2 :command-list ())) + ((= v1-7 1) (new 'static 'spool-anim :name "fuel-cell-victory-2" :index 4 :parts 2 :command-list ())) + ((= v1-7 2) (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list ())) + ((= v1-7 3) (new 'static 'spool-anim :name "fuel-cell-victory-4" :index 6 :parts 2 :command-list ())) + ((= v1-7 4) (new 'static 'spool-anim :name "fuel-cell-victory-5" :index 7 :parts 2 :command-list ())) + ((= v1-7 5) (new 'static 'spool-anim :name "fuel-cell-victory-6" :index 8 :parts 2 :command-list ())) + ((= v1-7 6) (new 'static 'spool-anim :name "fuel-cell-victory-7" :index 9 :parts 2 :command-list ())) + ((= v1-7 7) (new 'static 'spool-anim :name "fuel-cell-victory-8" :index 10 :parts 2 :command-list ())) + ((= v1-7 16) (new 'static 'spool-anim :name "fuel-cell-racer-victory-1" :index 40 :parts 2 :command-list ())) + ((= v1-7 32) (new 'static 'spool-anim :name "fuel-cell-flut-victory-1" :index 44 :parts 2 :command-list ())) + (else (new 'static 'spool-anim :name "fuel-cell-victory-3" :index 5 :parts 2 :command-list ()))))) (defbehavior fuel-cell-animate fuel-cell () (let* ((gp-0 self) - (s5-0 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) fuel-cell)) - gp-0 - ) - ) - ) + (s5-0 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) fuel-cell)) gp-0))) (cond (s5-0 - (set! (-> s5-0 victory-anim) (fuel-cell-pick-anim s5-0)) - (spool-push *art-control* (-> s5-0 victory-anim name) 0 self (the-as float -99.0)) - ) - (else - (let ((v1-5 (fuel-cell-pick-anim self))) - (spool-push *art-control* (-> v1-5 name) 0 self (the-as float -99.0)) - ) - ) - ) - ) + (set! (-> s5-0 victory-anim) (fuel-cell-pick-anim s5-0)) + (spool-push *art-control* (-> s5-0 victory-anim name) 0 self (the-as float -99.0))) + (else (let ((v1-5 (fuel-cell-pick-anim self))) (spool-push *art-control* (-> v1-5 name) 0 self (the-as float -99.0)))))) (when (nonzero? (-> self part)) (cond ((logtest? (-> self draw status) (draw-status hidden no-anim)) (kill-and-free-particles (-> self part)) - (if (nonzero? (-> self sound)) - (kill-and-free-particles (-> self part)) - ) - ) + (if (nonzero? (-> self sound)) (kill-and-free-particles (-> self part)))) (else - (let* ((gp-1 (-> self root)) - (v1-20 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) - gp-1 - ) - ) - (gp-2 (if v1-20 - (-> v1-20 root-prim prim-core) - (-> self root trans) - ) - ) - ) - (spawn (-> self part) (the-as vector gp-2)) - (when (nonzero? (-> self sound)) - (update-trans! (-> self sound) (the-as vector gp-2)) - (update! (-> self sound)) - ) - ) - ) - ) - ) + (let* ((gp-1 (-> self root)) + (v1-20 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1)) + (gp-2 (if v1-20 (-> v1-20 root-prim prim-core) (-> self root trans)))) + (spawn (-> self part) (the-as vector gp-2)) + (when (nonzero? (-> self sound)) + (update-trans! (-> self sound) (the-as vector gp-2)) + (update! (-> self sound))))))) (set-vector! (-> self draw color-mult) 0.5 0.5 0.5 1.0) (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 1.0) 0 - (none) - ) + (none)) (method-set! fuel-cell 29 fuel-cell-animate) (defstate wait (fuel-cell) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (local-vars (v0-3 object)) - (when (and (or (= message 'touch) (= message 'attack)) - (and (logtest? (-> self flags) (collectable-flags can-collect)) - (time-elapsed? (-> self birth-time) (-> self collect-timeout)) - (and (not (handle->process (-> *game-info* other-camera-handle))) - (not *progress-process*) - (!= (-> self next-state name) 'pickup) - *target* - (not (logtest? (-> *target* state-flags) (state-flags grabbed dying))) - ) - ) - ) - (add-setting! 'allow-progress #f 0.0 0) - (apply-settings *setting-control*) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle proc)) - ) - (cond - ((= message 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root trans quad)) - (update-transforms! (-> self root)) - ) - ((= message 'pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root) (the-as vector (-> block param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (process->handle *target*)) - ) - ) - ((= message 'collide-shape) - (if (-> block param 0) - (restore-collide-with-as (-> self root)) - (clear-collide-with-as (-> self root)) - ) - ) - ((= message 'movie-pos) - (set! v0-3 (-> block param 0)) - (set! (-> self movie-pos-index) (the-as int v0-3)) - v0-3 - ) - ((= message 'anim) - (cond - ((-> block param 0) - (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - (else - (set! v0-3 (logior (-> self flags) (collectable-flags anim))) - (set! (-> self flags) (the-as collectable-flags v0-3)) - ) - ) - v0-3 - ) - ) - ) - :code (behavior () - 0.5 - (let ((f28-0 0.0)) - (ja :group! fuel-cell-idle-ja) - (loop - (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) - (set! f28-0 - (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) - (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) - (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))) - ) - ) - (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) - (let ((f30-1 - (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)) - ) - ) - (transform-post) - (fuel-cell-animate) - (suspend) - (ja :num! (loop! f30-1)) - ) - ) - ) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-3 object)) + (when (and (or (= message 'touch) (= message 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) + (and (not (handle->process (-> *game-info* other-camera-handle))) + (not *progress-process*) + (!= (-> self next-state name) 'pickup) + *target* + (not (logtest? (-> *target* state-flags) (state-flags grabbed dying)))))) + (add-setting! 'allow-progress #f 0.0 0) + (apply-settings *setting-control*) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle proc))) + (cond + ((= message 'trans) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root))) + ((= message 'pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) (move-to-point! (-> self root) (the-as vector (-> block param 0)))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (process->handle *target*)))) + ((= message 'collide-shape) + (if (-> block param 0) (restore-collide-with-as (-> self root)) (clear-collide-with-as (-> self root)))) + ((= message 'movie-pos) (set! v0-3 (-> block param 0)) (set! (-> self movie-pos-index) (the-as int v0-3)) v0-3) + ((= message 'anim) + (cond + ((-> block param 0) + (set! v0-3 (logclear (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3))) + (else + (set! v0-3 (logior (-> self flags) (collectable-flags anim))) + (set! (-> self flags) (the-as collectable-flags v0-3)))) + v0-3))) + :code + (behavior () + 0.5 + (let ((f28-0 0.0)) + (ja :group! fuel-cell-idle-ja) + (loop (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) + (set! f28-0 + (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) + (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) + (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))))) + (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) + (let ((f30-1 (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)))) + (transform-post) + (fuel-cell-animate) + (suspend) + (ja :num! (loop! f30-1)))))))) (defstate pickup (fuel-cell) :virtual #t - :enter (behavior ((arg0 object) (arg1 handle)) - (set-time! (-> self state-time)) - (set! (-> self state-object) #t) - (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-state)) enter))) - (if t9-1 - (t9-1) - ) - ) - ) - :trans (behavior () - (let ((f30-0 (the-as float (cond - ((string= (-> self victory-anim name) "fuel-cell-victory") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-2") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-3") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-4") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-5") - 77.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-6") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-7") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-victory-8") - 97.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-racer-victory-1") - 88.0 - ) - ((string= (-> self victory-anim name) "fuel-cell-flut-victory-1") - 150.0 - ) - (else - 5000.0 - ) - ) - ) - ) - ) - (when (and (logtest? (-> self skel status) (janim-status spool)) - (and (>= (ja-aframe-num 0) f30-0) (-> self state-object)) - ) - (set! (-> self state-object) #f) - (kill-and-free-particles (-> self part)) - (logior! (-> self draw status) (draw-status skip-bones)) - (if (not (or (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) - (fact-options powerup) - ) - (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - ) - ) - (send-event *camera* 'teleport-to-other-start-string) - ) - ) - ) - ) - :code (behavior ((arg0 object) (arg1 handle)) - (local-vars (sv-96 res-tag)) - (sound-play "pu-powercell") - (clear-collide-with-as (-> self root)) - (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self draw status) (draw-status hidden)) - (process-entity-status! self (entity-perm-status dead) #t) - (stop! (-> self sound)) - (while (handle->process (-> *game-info* other-camera-handle)) - (format - #t - "WARNING: fuel-cell stall ~D ~A ~A~%" - (current-time) - (handle->process (-> *game-info* other-camera-handle)) - (-> *level* loading-level) - ) - (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) - (suspend) - ) - (while (not (send-event *target* 'clone-anim self)) - (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) - (format #t "WARNING: fuel-cell stall on not cloning.~%") - (suspend) - ) - (set! sv-96 (new 'static 'res-tag)) - (let* ((v1-34 - (res-lump-data - (-> self entity) - 'movie-pos - (inline-array vector) - :tag-ptr (& sv-96) - :time (the-as float -1000000000.0) - ) - ) - (gp-1 (if (and v1-34 (< (-> self movie-pos-index) (the-as int (-> sv-96 elt-count)))) + :enter + (behavior ((arg0 object) (arg1 handle)) + (set-time! (-> self state-time)) + (set! (-> self state-object) #t) + (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-state)) enter))) (if t9-1 (t9-1)))) + :trans + (behavior () + (let ((f30-0 (the-as float + (cond + ((string= (-> self victory-anim name) "fuel-cell-victory") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-2") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-3") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-4") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-5") 77.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-6") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-7") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-victory-8") 97.0) + ((string= (-> self victory-anim name) "fuel-cell-racer-victory-1") 88.0) + ((string= (-> self victory-anim name) "fuel-cell-flut-victory-1") 150.0) + (else 5000.0))))) + (when (and (logtest? (-> self skel status) (janim-status spool)) (and (>= (ja-aframe-num 0) f30-0) (-> self state-object))) + (set! (-> self state-object) #f) + (kill-and-free-particles (-> self part)) + (logior! (-> self draw status) (draw-status skip-bones)) + (if (not (or (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (fact-options powerup)) + (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))))) + (send-event *camera* 'teleport-to-other-start-string))))) + :code + (behavior ((arg0 object) (arg1 handle)) + (local-vars (sv-96 res-tag)) + (sound-play "pu-powercell") + (clear-collide-with-as (-> self root)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self draw status) (draw-status hidden)) + (process-entity-status! self (entity-perm-status dead) #t) + (stop! (-> self sound)) + (while (handle->process (-> *game-info* other-camera-handle)) + (format #t + "WARNING: fuel-cell stall ~D ~A ~A~%" + (current-time) + (handle->process (-> *game-info* other-camera-handle)) + (-> *level* loading-level)) + (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) + (suspend)) + (while (not (send-event *target* 'clone-anim self)) + (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) + (format #t "WARNING: fuel-cell stall on not cloning.~%") + (suspend)) + (set! sv-96 (new 'static 'res-tag)) + (let* ((v1-34 (res-lump-data (-> self entity) 'movie-pos (inline-array vector) :tag-ptr (& sv-96) :time (the-as float -1000000000.0))) + (gp-1 (if (and v1-34 (< (-> self movie-pos-index) (the-as int (-> sv-96 elt-count)))) (-> v1-34 (-> self movie-pos-index)) - (the-as vector #f) - ) - ) - ) - (cond - ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) - (move-to-point! (-> self root) *fuel-cell-tune-pos*) - (set-yaw-angle-clear-roll-pitch! (-> self root) (-> *fuel-cell-tune-pos* w)) - ) - ((= (-> self movie-pos-index) -1) - ) - (gp-1 - (move-to-point! (-> self root) gp-1) - (set-yaw-angle-clear-roll-pitch! (-> self root) (-> gp-1 w)) - ) - (else - (move-to-point! (-> self root) (-> *target* control trans)) - (set-yaw-angle-clear-roll-pitch! (-> self root) (y-angle (-> *target* control))) - (move-to-ground (-> self root) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background)) - ) - ) - ) - (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) - (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - (set! (-> self draw bounds w) 32768.0) - (logior! (-> self skel status) (janim-status inited)) - (send-event *target* 'blend-shape #t) - (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) - (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) - (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) - (process-spawn othercam self 10 #f #t :to self) - (auto-save-command 'auto-save 0 0 *default-pool*) - (ja-play-spooled-anim - (-> self victory-anim) - (the-as art-joint-anim fuel-cell-idle-ja) - (the-as art-joint-anim #f) - (the-as (function process-drawable symbol) false-func) - ) - (remove-setting! 'music-volume) - (remove-setting! 'sfx-volume) - (remove-setting! 'ambient-volume) - (send-event *target* 'blend-shape #f) - (send-event *target* 'end-mode) - (send-event *camera* 'no-intro) - (send-event *camera* 'clear-entity) - (ja-channel-set! 0) - (suspend) - (suspend) - (process-spawn-function - process - (lambda :behavior collectable - ((arg0 game-task)) - (while (or (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - (str-is-playing?) - ) - (suspend) - ) + (the-as vector #f)))) (cond - ((= arg0 (game-task training-buzzer)) - (level-hint-spawn - (text-id training-buzzer-resolution) - "asstvb45" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task training-door)) - (level-hint-spawn - (text-id training-eco-opened-door) - "sagevb25" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task beach-ecorocks)) - (level-hint-spawn - (text-id beach-ecorocks-resolution) - "sagevb01" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-cannon)) - (level-hint-spawn - (text-id misty-cannon-resolution) - "sagevb02" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-bike)) - (level-hint-spawn - (text-id misty-bike-resolution) - "asstvb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-end)) - (level-hint-spawn - (text-id firecanyon-end-resolution) - "sksp0095" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-robbers)) - (level-hint-spawn - (text-id rolling-robbers-resolution) - "asstvb20" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-plants)) - (level-hint-spawn - (text-id rolling-plants-resolution) - "sagevb03" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-flutflut)) - (level-hint-spawn - (text-id swamp-flutflut-resolution) - "asstvb21" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-boss)) - (level-hint-spawn (text-id ogre-boss-resolution) "asstvb23" (the-as entity #f) *entity-pool* (game-task none)) - ) - ((= arg0 (game-task ogre-end)) - (level-hint-spawn (text-id ogre-race-resolution) "asstvb25" (the-as entity #f) *entity-pool* (game-task none)) - ) - ((= arg0 (game-task beach-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task jungle-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task misty-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task firecanyon-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task rolling-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task sunken-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task swamp-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task ogre-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task cave-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task snow-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task lavatube-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task citadel-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village1-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village2-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ((= arg0 (game-task village3-buzzer)) - (level-hint-spawn - (text-id sidekick-buzzer-resolution) - "sksp009k" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (none) - ) - (the int (-> self fact pickup-amount)) - :to self - ) - (case (the int (-> self fact pickup-amount)) - (((game-task citadel-sage-blue)) - (send-event (process-by-name "blue-sagecage-1" *active-pool*) 'play-anim) - ) - (((game-task citadel-sage-red)) - (send-event (process-by-name "red-sagecage-1" *active-pool*) 'play-anim) - ) - (((game-task citadel-sage-yellow)) - (send-event (process-by-name "yellow-sagecage-1" *active-pool*) 'play-anim) - ) - (((game-task citadel-sage-green)) - (send-event (process-by-name "green-sagecage-1" *active-pool*) 'play-anim) - ) - (((game-task jungle-eggtop) (game-task snow-eggtop) (game-task snow-ball) (game-task sunken-slide)) - ) - (else - (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - ) - ) - (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell)))) - ) - :post (behavior () - (transform-post) - (if (-> self state-object) - (spawn (-> self part) (the-as vector (-> self root root-prim prim-core))) - ) - ) - ) + ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) + (move-to-point! (-> self root) *fuel-cell-tune-pos*) + (set-yaw-angle-clear-roll-pitch! (-> self root) (-> *fuel-cell-tune-pos* w))) + ((= (-> self movie-pos-index) -1)) + (gp-1 (move-to-point! (-> self root) gp-1) (set-yaw-angle-clear-roll-pitch! (-> self root) (-> gp-1 w))) + (else + (move-to-point! (-> self root) (-> *target* control trans)) + (set-yaw-angle-clear-roll-pitch! (-> self root) (y-angle (-> *target* control))) + (move-to-ground (-> self root) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background))))) + (spool-push *art-control* (-> self victory-anim name) 0 self (the-as float -99.0)) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + (set! (-> self draw bounds w) 32768.0) + (logior! (-> self skel status) (janim-status inited)) + (send-event *target* 'blend-shape #t) + (add-setting! 'music-volume 'rel (-> *setting-control* current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* current sfx-volume-movie) 0) + (add-setting! 'ambient-volume 'rel (-> *setting-control* current ambient-volume-movie) 0) + (process-spawn othercam self 10 #f #t :to self) + (auto-save-command 'auto-save 0 0 *default-pool*) + (ja-play-spooled-anim (-> self victory-anim) + (the-as art-joint-anim fuel-cell-idle-ja) + (the-as art-joint-anim #f) + (the-as (function process-drawable symbol) false-func)) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (send-event *target* 'blend-shape #f) + (send-event *target* 'end-mode) + (send-event *camera* 'no-intro) + (send-event *camera* 'clear-entity) + (ja-channel-set! 0) + (suspend) + (suspend) + (process-spawn-function process + (lambda :behavior collectable ((arg0 game-task)) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + (str-is-playing?)) + (suspend)) + (cond + ((= arg0 (game-task training-buzzer)) + (level-hint-spawn (text-id training-buzzer-resolution) "asstvb45" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task training-door)) + (level-hint-spawn (text-id training-eco-opened-door) "sagevb25" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task beach-ecorocks)) + (level-hint-spawn (text-id beach-ecorocks-resolution) "sagevb01" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task misty-cannon)) + (level-hint-spawn (text-id misty-cannon-resolution) "sagevb02" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task misty-bike)) + (level-hint-spawn (text-id misty-bike-resolution) "asstvb03" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task firecanyon-end)) + (level-hint-spawn (text-id firecanyon-end-resolution) "sksp0095" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task rolling-robbers)) + (level-hint-spawn (text-id rolling-robbers-resolution) "asstvb20" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task rolling-plants)) + (level-hint-spawn (text-id rolling-plants-resolution) "sagevb03" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task swamp-flutflut)) + (level-hint-spawn (text-id swamp-flutflut-resolution) "asstvb21" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task ogre-boss)) + (level-hint-spawn (text-id ogre-boss-resolution) "asstvb23" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task ogre-end)) + (level-hint-spawn (text-id ogre-race-resolution) "asstvb25" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task beach-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task jungle-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task misty-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task firecanyon-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task rolling-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task sunken-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task swamp-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task ogre-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task cave-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task snow-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task lavatube-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task citadel-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task village1-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task village2-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none))) + ((= arg0 (game-task village3-buzzer)) + (level-hint-spawn (text-id sidekick-buzzer-resolution) "sksp009k" (the-as entity #f) *entity-pool* (game-task none)))) + (none)) + (the int (-> self fact pickup-amount)) + :to + self) + (case (the int (-> self fact pickup-amount)) + (((game-task citadel-sage-blue)) (send-event (process-by-name "blue-sagecage-1" *active-pool*) 'play-anim)) + (((game-task citadel-sage-red)) (send-event (process-by-name "red-sagecage-1" *active-pool*) 'play-anim)) + (((game-task citadel-sage-yellow)) (send-event (process-by-name "yellow-sagecage-1" *active-pool*) 'play-anim)) + (((game-task citadel-sage-green)) (send-event (process-by-name "green-sagecage-1" *active-pool*) 'play-anim)) + (((game-task jungle-eggtop) (game-task snow-eggtop) (game-task snow-ball) (game-task sunken-slide))) + (else (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show))) + (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell))))) + :post + (behavior () + (transform-post) + (if (-> self state-object) (spawn (-> self part) (the-as vector (-> self root root-prim prim-core)))))) (defmethod initialize ((this fuel-cell)) (stack-size-set! (-> this main-thread) 512) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind powerup)) (set! (-> s4-0 collide-with) (collide-kind target)) (set! (-> s4-0 transform-index) 3) (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4915.2) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) (set! (-> this notify-parent) #f) (set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0))) - (initialize-skeleton this *fuel-cell-sg* '()) + (initialize-skeleton this *fuel-cell-sg* ()) (set! (-> this base quad) (-> this root trans quad)) (set! (-> this old-base quad) (-> this root trans quad)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this)) - (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root trans)) - ) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root trans))) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) - this - ) + this) (defmethod init-from-entity! ((this fuel-cell) (arg0 entity-actor)) (initialize this) @@ -1900,20 +1123,17 @@ (logclear! (-> this fact options) (fact-options can-collect)) (update-transforms! (-> this root)) (go (method-of-object this wait)) - (none) - ) + (none)) (defbehavior fuel-cell-init-by-other fuel-cell ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) - (f30-0 (-> arg2 pickup-spawn-amount)) - ) + (f30-0 (-> arg2 pickup-spawn-amount))) (set! (-> self entity) arg3) (set! (-> self pickup-type) s3-0) (set! (-> self pickup-amount) f30-0) (initialize self) (set! (-> self fact pickup-type) s3-0) - (set! (-> self fact pickup-amount) f30-0) - ) + (set! (-> self fact pickup-amount) f30-0)) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) (set! (-> self root trans quad) (-> arg0 quad)) @@ -1928,71 +1148,53 @@ ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) (set! (-> self jump-pos quad) (-> *fuel-cell-tune-pos* quad)) (+! (-> self jump-pos y) 4096.0) - (go-virtual jump) - ) + (go-virtual jump)) ((and gp-1 (not (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) - (fact-options skip-jump-anim) - ) - ) - (not (logtest? (-> self fact options) (fact-options skip-jump-anim))) - ) + (fact-options skip-jump-anim))) + (not (logtest? (-> self fact options) (fact-options skip-jump-anim)))) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) (+! (-> self jump-pos y) 4096.0) - (go-virtual jump) - ) - ) - ) + (go-virtual jump)))) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) - (none) - ) + (none)) (defstate fuel-cell-clone-anim (fuel-cell) - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('pickup) - (when (!= (-> self next-state name) 'pickup) - (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root) (the-as vector (-> block param 0))) - ) - (logclear! (-> self mask) (process-mask actor-pause)) - (go-virtual pickup #f (the-as handle #f)) - ) - ) - (('trans) - (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root trans quad)) - (update-transforms! (-> self root)) - ) - (('stop-cloning 'notify) - (set! (-> self root trans quad) (-> self draw origin quad)) - (set! (-> self base quad) (-> self root trans quad)) - (ja-channel-set! 1) - (ja :group! fuel-cell-idle-ja) - (logclear! (-> self draw status) (draw-status hidden)) - (vector-reset! (-> self draw origin)) - (go-virtual wait) - ) - ) - ) - :exit (behavior () - (if (-> self actor-pause) - (logior! (-> self mask) (process-mask actor-pause)) - ) - (logclear! (-> self skel status) (janim-status spool)) - ) - :code (behavior ((arg0 handle)) - (logclear! (-> self mask) (process-mask actor-pause)) - (clone-anim arg0 3 #t "") - (format #t "ERROR: clone-anim returned in fuel-cell~%") - (deactivate self) - ) - :post (behavior () - (update-transforms! (-> self root)) - (animate self) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pickup) + (when (!= (-> self next-state name) 'pickup) + (if (and (> argc 0) (-> block param 0)) (move-to-point! (-> self root) (the-as vector (-> block param 0)))) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual pickup #f (the-as handle #f)))) + (('trans) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root))) + (('stop-cloning 'notify) + (set! (-> self root trans quad) (-> self draw origin quad)) + (set! (-> self base quad) (-> self root trans quad)) + (ja-channel-set! 1) + (ja :group! fuel-cell-idle-ja) + (logclear! (-> self draw status) (draw-status hidden)) + (vector-reset! (-> self draw origin)) + (go-virtual wait)))) + :exit + (behavior () + (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause))) + (logclear! (-> self skel status) (janim-status spool))) + :code + (behavior ((arg0 handle)) + (logclear! (-> self mask) (process-mask actor-pause)) + (clone-anim arg0 3 #t "") + (format #t "ERROR: clone-anim returned in fuel-cell~%") + (deactivate self)) + :post + (behavior () + (update-transforms! (-> self root)) + (animate self))) (defbehavior fuel-cell-init-as-clone fuel-cell ((arg0 handle) (arg1 int)) (initialize self) @@ -2003,195 +1205,124 @@ (set! (-> self actor-pause) #f) (sound-play "cell-prize") (go fuel-cell-clone-anim arg0) - (none) - ) + (none)) -(defskelgroup *buzzer-sg* buzzer buzzer-lod0-jg buzzer-idle-ja - ((buzzer-lod0-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *buzzer-sg* + buzzer + buzzer-lod0-jg + buzzer-idle-ja + ((buzzer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) (deftype buzzer (eco-collectable) - ((victory-anim spool-anim) - ) - ) - + ((victory-anim spool-anim))) (defmethod animate ((this buzzer)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) - (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) - ) + (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!)) (let ((f0-3 (y-angle (-> this root)))) (set! (-> *part-id-table* 239 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) - (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) - ) + (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3))) (spawn (-> this part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) - (if (nonzero? (-> this sound)) - (update! (-> this sound)) - ) + (if (nonzero? (-> this sound)) (update! (-> this sound))) (if (and *target* (>= (-> *target* fact buzzer) 6.0)) - (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0)) - ) + (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0))) 0 - (none) - ) + (none)) (defstate wait (buzzer) :virtual #t - :code (behavior () - (case (get-reminder (get-task-control (the-as game-task (logand (the int (-> self fact pickup-amount)) #xffff))) 0) - ((127) - (go-virtual pickup #t (the-as handle #f)) - ) - ) - (loop - (transform-post) - (animate self) - (suspend) - ) - ) - ) + :code + (behavior () + (case (get-reminder (get-task-control (the-as game-task (logand (the int (-> self fact pickup-amount)) #xffff))) 0) + ((127) (go-virtual pickup #t (the-as handle #f)))) + (loop (transform-post) + (animate self) + (suspend)))) (defstate pickup (buzzer) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('notify) - (process-entity-status! self (entity-perm-status dead) #t) - ) - ) - ) - :enter (behavior ((arg0 object) (arg1 handle)) - (set! (-> self pickup-handle) arg1) - (logclear! (-> self mask) (process-mask actor-pause)) - ) - :code (behavior ((arg0 object) (arg1 handle)) - (logclear! (-> self mask) (process-mask actor-pause)) - (process-entity-status! self (entity-perm-status complete) #t) - (sound-play "buzzer-pickup") - (case (-> (level-get-target-inside *level*) name) - (('training) - (level-hint-spawn (text-id training-buzzer-hint) "asstvb44" (the-as entity #f) *entity-pool* (game-task none)) - ) - (('firecanyon) - (level-hint-spawn - (text-id firecanyon-buzzer-hint) - "sksp0096" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - (else - (level-hint-spawn - (text-id sidekick-hint-buzzer3) - "sksp009j" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - (ja-channel-set! 0) - (clear-collide-with-as (-> self root)) - (if (nonzero? (-> self sound)) - (stop! (-> self sound)) - ) - (when (not arg0) - (let ((v1-18 (manipy-spawn (-> self root trans) #f *buzzer-sg* #f :to *entity-pool*))) - (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))) - ) - ) - (let* ((s5-2 (logand (the int (-> self fact pickup-amount)) #xffff)) - (s4-1 (get-task-control (the-as game-task s5-2))) - ) - (if (nonzero? s5-2) - (close-specific-task! (the-as game-task s5-2) (task-status need-hint)) - ) - (when (and (= (get-reminder s4-1 0) 127) - (and (-> self entity) (not (task-complete? *game-info* (the-as game-task s5-2)))) - ) - (if (and *target* - (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut)) - (not arg0) - ) - (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim)) - ) - (let ((v1-47 (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) - (pickup-type fuel-cell) - (the float s5-2) - #f - self - (-> self fact) - ) - ) - ) - (when v1-47 - (send-event (ppointer->process v1-47) 'movie-pos (-> self movie-pos-index)) - (ja-channel-set! 0) - (clear-collide-with-as (-> self root)) - (ja-post) - (while (-> self child) - (suspend) - ) - ) - ) - ) - ) - (when (-> self notify-parent) - (let ((gp-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> gp-1 from) self) - (set! (-> gp-1 num-params) 1) - (set! (-> gp-1 message) 'notify) - (set! (-> gp-1 param 0) (the-as uint 'pickup)) - (let ((s5-3 send-event-function) - (s4-2 (ppointer->process (-> self parent))) - ) - (s5-3 - (if (and (nonzero? s4-2) (type-type? (-> s4-2 type) process)) - s4-2 - ) - gp-1 - ) - ) - ) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) (process-entity-status! self (entity-perm-status dead) #t)))) + :enter + (behavior ((arg0 object) (arg1 handle)) + (set! (-> self pickup-handle) arg1) + (logclear! (-> self mask) (process-mask actor-pause))) + :code + (behavior ((arg0 object) (arg1 handle)) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status complete) #t) + (sound-play "buzzer-pickup") + (case (-> (level-get-target-inside *level*) name) + (('training) + (level-hint-spawn (text-id training-buzzer-hint) "asstvb44" (the-as entity #f) *entity-pool* (game-task none))) + (('firecanyon) + (level-hint-spawn (text-id firecanyon-buzzer-hint) "sksp0096" (the-as entity #f) *entity-pool* (game-task none))) + (else (level-hint-spawn (text-id sidekick-hint-buzzer3) "sksp009j" (the-as entity #f) *entity-pool* (game-task none)))) + (ja-channel-set! 0) + (clear-collide-with-as (-> self root)) + (if (nonzero? (-> self sound)) (stop! (-> self sound))) + (when (not arg0) + (let ((v1-18 (manipy-spawn (-> self root trans) #f *buzzer-sg* #f :to *entity-pool*))) + (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))))) + (let* ((s5-2 (logand (the int (-> self fact pickup-amount)) #xffff)) + (s4-1 (get-task-control (the-as game-task s5-2)))) + (if (nonzero? s5-2) (close-specific-task! (the-as game-task s5-2) (task-status need-hint))) + (when (and (= (get-reminder s4-1 0) 127) (and (-> self entity) (not (task-complete? *game-info* (the-as game-task s5-2))))) + (if (and *target* + (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut)) + (not arg0)) + (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim))) + (let ((v1-47 (birth-pickup-at-point (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) + (pickup-type fuel-cell) + (the float s5-2) + #f + self + (-> self fact)))) + (when v1-47 + (send-event (ppointer->process v1-47) 'movie-pos (-> self movie-pos-index)) + (ja-channel-set! 0) + (clear-collide-with-as (-> self root)) + (ja-post) + (while (-> self child) + (suspend)))))) + (when (-> self notify-parent) + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) self) + (set! (-> gp-1 num-params) 1) + (set! (-> gp-1 message) 'notify) + (set! (-> gp-1 param 0) (the-as uint 'pickup)) + (let ((s5-3 send-event-function) + (s4-2 (ppointer->process (-> self parent)))) + (s5-3 (if (and (nonzero? s4-2) (type-type? (-> s4-2 type) process)) s4-2) gp-1)))))) (defmethod initialize ((this buzzer)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind powerup blue-eco-suck)) (set! (-> s4-0 collide-with) (collide-kind target)) (set-vector! (-> s4-0 local-sphere) 0.0 2457.6 0.0 4915.2) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root) s5-0) - ) + (set! (-> this root) s5-0)) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) (set! (-> this notify-parent) #f) (set! (-> this fact) (new 'process 'fact-info this (pickup-type buzzer) (the-as float 0.0))) - (initialize-skeleton this *buzzer-sg* '()) + (initialize-skeleton this *buzzer-sg* ()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this)) - (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root trans)) - ) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root trans))) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) - this - ) + this) (defmethod init-from-entity! ((this buzzer) (arg0 entity-actor)) (initialize this) @@ -2201,23 +1332,19 @@ (update-transforms! (-> this root)) (update-trans! (-> this sound) (-> this root trans)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) - (go (method-of-object this wait)) - (go (method-of-object this pickup) #t (the-as handle #f)) - ) - (none) - ) + (go (method-of-object this wait)) + (go (method-of-object this pickup) #t (the-as handle #f))) + (none)) (defbehavior buzzer-init-by-other buzzer ((arg0 vector) (arg1 vector) (arg2 fact-info) (arg3 entity-actor)) (let ((s3-0 (-> arg2 pickup-type)) - (f30-0 (-> arg2 pickup-spawn-amount)) - ) + (f30-0 (-> arg2 pickup-spawn-amount))) (set! (-> self entity) arg3) (set! (-> self pickup-type) s3-0) (set! (-> self pickup-amount) f30-0) (initialize self) (set! (-> self fact pickup-type) s3-0) - (set! (-> self fact pickup-amount) f30-0) - ) + (set! (-> self fact pickup-amount) f30-0)) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) (set! (-> self root trans quad) (-> arg0 quad)) @@ -2229,42 +1356,22 @@ (update-trans! (-> self sound) (-> self root trans)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) - (none) - ) + (none)) (defmethod init-from-entity! ((this eco) (arg0 entity-actor)) (let ((v1-2 (res-lump-value (-> this entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) - (set! (-> this type) (cond - ((= v1-2 (pickup-type eco-blue)) - eco-blue - ) - ((= v1-2 (pickup-type eco-red)) - eco-red - ) - ((= v1-2 (pickup-type eco-yellow)) - eco-yellow - ) - ((= v1-2 (pickup-type eco-green)) - health - ) - ((= v1-2 (pickup-type money)) - money - ) - ((= v1-2 (pickup-type fuel-cell)) - fuel-cell - ) - ((= v1-2 (pickup-type buzzer)) - buzzer - ) - (else - eco-pill - ) - ) - ) - ) + (set! (-> this type) + (cond + ((= v1-2 (pickup-type eco-blue)) eco-blue) + ((= v1-2 (pickup-type eco-red)) eco-red) + ((= v1-2 (pickup-type eco-yellow)) eco-yellow) + ((= v1-2 (pickup-type eco-green)) health) + ((= v1-2 (pickup-type money)) money) + ((= v1-2 (pickup-type fuel-cell)) fuel-cell) + ((= v1-2 (pickup-type buzzer)) buzzer) + (else eco-pill)))) (init-from-entity! this arg0) - (none) - ) + (none)) (defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info)) (local-vars @@ -2287,191 +1394,132 @@ (sv-144 process) (sv-160 process) (sv-176 process) - (sv-192 (pointer process)) - ) + (sv-192 (pointer process))) (set! sv-32 arg5) (let ((s1-0 (new-stack-vector0)) - (t9-0 (method-of-type res-lump get-property-value-float)) - ) - (let ((v1-1 sv-32)) - (b! (not v1-1) cfg-3 :likely-delay (set! v1-2 sv-32)) - ) + (t9-0 (method-of-type res-lump get-property-value-float))) + (let ((v1-1 sv-32)) (b! (not v1-1) cfg-3 :likely-delay (set! v1-2 sv-32))) (set! v1-2 (nonzero? (-> sv-32 process))) (label cfg-3) - (let ((f30-0 (t9-0 - (if v1-2 - (-> sv-32 process entity) - ) - 'pickup-radius - 'interp - (the-as float -1000000000.0) - (the-as float (cond - ((= arg1 (pickup-type buzzer)) - 0.0 - ) - ((= arg2 1.0) - 409.6 - ) - (else - 8192.0 - ) - ) - ) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) + (let ((f30-0 (t9-0 (if v1-2 (-> sv-32 process entity)) + 'pickup-radius + 'interp + (the-as float -1000000000.0) + (the-as float + (cond + ((= arg1 (pickup-type buzzer)) 0.0) + ((= arg2 1.0) 409.6) + (else 8192.0))) + (the-as (pointer res-tag) #f) + *res-static-buf*))) (set! sv-192 (the-as (pointer process) #f)) (set! sv-48 (the int arg2)) (let ((s0-0 (new 'static 'fact-info))) (set! (-> s0-0 options) (fact-options)) - (if sv-32 - (mem-copy! (&-> s0-0 type) (&-> sv-32 type) 40) - ) + (if sv-32 (mem-copy! (&-> s0-0 type) (&-> sv-32 type) 40)) (set! (-> s0-0 pickup-type) arg1) (set! (-> s0-0 pickup-spawn-amount) 1.0) (while (> sv-48 0) (set! sv-48 (+ sv-48 -1)) (when arg3 (set-vector! s1-0 0.0 57001.605 f30-0 1.0) - (vector-rotate-around-y! s1-0 s1-0 (/ (* 65536.0 (the float sv-48)) arg2)) - ) + (vector-rotate-around-y! s1-0 s1-0 (/ (* 65536.0 (the float sv-48)) arg2))) (let ((v1-25 arg1)) (cond ((= v1-25 (pickup-type eco-yellow)) (set! sv-64 (get-process *pickup-dead-pool* eco-yellow #x4000)) - (set! v1-28 (when sv-64 - (set! sv-192 (the-as (pointer process) v1-28)) - (let ((t9-4 (method-of-type eco-yellow activate))) - (t9-4 (the-as eco-yellow sv-64) arg4 'eco-yellow (the-as pointer #x70004000)) - ) - (run-now-in-process sv-64 initialize-eco-by-other arg0 s1-0 s0-0) - (set! sv-192 (-> sv-64 ppointer)) - v1-28 - ) - ) - sv-192 - ) + (set! v1-28 + (when sv-64 + (set! sv-192 (the-as (pointer process) v1-28)) + (let ((t9-4 (method-of-type eco-yellow activate))) + (t9-4 (the-as eco-yellow sv-64) arg4 'eco-yellow (the-as pointer #x70004000))) + (run-now-in-process sv-64 initialize-eco-by-other arg0 s1-0 s0-0) + (set! sv-192 (-> sv-64 ppointer)) + v1-28)) + sv-192) ((= v1-25 (pickup-type eco-red)) (set! sv-80 (get-process *pickup-dead-pool* eco-red #x4000)) - (set! v1-34 (when sv-80 - (set! sv-192 (the-as (pointer process) v1-34)) - (let ((t9-7 (method-of-type eco-red activate))) - (t9-7 (the-as eco-red sv-80) arg4 'eco-red (the-as pointer #x70004000)) - ) - (run-now-in-process sv-80 initialize-eco-by-other arg0 s1-0 s0-0) - (set! sv-192 (-> sv-80 ppointer)) - v1-34 - ) - ) - (level-hint-spawn (text-id misty-eco-red-hint) "sksp0071" (the-as entity #f) *entity-pool* (game-task none)) - ) + (set! v1-34 + (when sv-80 + (set! sv-192 (the-as (pointer process) v1-34)) + (let ((t9-7 (method-of-type eco-red activate))) (t9-7 (the-as eco-red sv-80) arg4 'eco-red (the-as pointer #x70004000))) + (run-now-in-process sv-80 initialize-eco-by-other arg0 s1-0 s0-0) + (set! sv-192 (-> sv-80 ppointer)) + v1-34)) + (level-hint-spawn (text-id misty-eco-red-hint) "sksp0071" (the-as entity #f) *entity-pool* (game-task none))) ((= v1-25 (pickup-type eco-blue)) (set! sv-96 (get-process *pickup-dead-pool* eco-blue #x4000)) - (set! v1-40 (when sv-96 - (set! sv-192 (the-as (pointer process) v1-40)) - (let ((t9-11 (method-of-type eco-blue activate))) - (t9-11 (the-as eco-blue sv-96) arg4 'eco-blue (the-as pointer #x70004000)) - ) - (run-now-in-process sv-96 initialize-eco-by-other arg0 s1-0 s0-0) - (set! sv-192 (-> sv-96 ppointer)) - v1-40 - ) - ) - sv-192 - ) + (set! v1-40 + (when sv-96 + (set! sv-192 (the-as (pointer process) v1-40)) + (let ((t9-11 (method-of-type eco-blue activate))) + (t9-11 (the-as eco-blue sv-96) arg4 'eco-blue (the-as pointer #x70004000))) + (run-now-in-process sv-96 initialize-eco-by-other arg0 s1-0 s0-0) + (set! sv-192 (-> sv-96 ppointer)) + v1-40)) + sv-192) ((= v1-25 (pickup-type eco-green)) (set! sv-112 (get-process *pickup-dead-pool* health #x4000)) - (set! v1-46 (when sv-112 - (set! sv-192 (the-as (pointer process) v1-46)) - (let ((t9-14 (method-of-type health activate))) - (t9-14 (the-as health sv-112) arg4 'health (the-as pointer #x70004000)) - ) - (run-now-in-process sv-112 initialize-eco-by-other arg0 s1-0 s0-0) - (set! sv-192 (-> sv-112 ppointer)) - v1-46 - ) - ) - sv-192 - ) + (set! v1-46 + (when sv-112 + (set! sv-192 (the-as (pointer process) v1-46)) + (let ((t9-14 (method-of-type health activate))) (t9-14 (the-as health sv-112) arg4 'health (the-as pointer #x70004000))) + (run-now-in-process sv-112 initialize-eco-by-other arg0 s1-0 s0-0) + (set! sv-192 (-> sv-112 ppointer)) + v1-46)) + sv-192) ((= v1-25 (pickup-type eco-pill)) (set! sv-128 (get-process *pickup-dead-pool* eco-pill #x4000)) - (set! v1-52 (when sv-128 - (set! sv-192 (the-as (pointer process) v1-52)) - (let ((t9-17 (method-of-type eco-pill activate))) - (t9-17 (the-as eco-pill sv-128) arg4 'eco-pill (the-as pointer #x70004000)) - ) - (run-now-in-process sv-128 initialize-eco-by-other arg0 s1-0 s0-0) - (set! sv-192 (-> sv-128 ppointer)) - v1-52 - ) - ) - sv-192 - ) + (set! v1-52 + (when sv-128 + (set! sv-192 (the-as (pointer process) v1-52)) + (let ((t9-17 (method-of-type eco-pill activate))) + (t9-17 (the-as eco-pill sv-128) arg4 'eco-pill (the-as pointer #x70004000))) + (run-now-in-process sv-128 initialize-eco-by-other arg0 s1-0 s0-0) + (set! sv-192 (-> sv-128 ppointer)) + v1-52)) + sv-192) ((= v1-25 (pickup-type money)) (set! sv-144 (get-process *pickup-dead-pool* money #x4000)) - (set! v1-58 (when sv-144 - (set! sv-192 (the-as (pointer process) v1-58)) - (let ((t9-20 (method-of-type money activate))) - (t9-20 (the-as money sv-144) arg4 'money (the-as pointer #x70004000)) - ) - (run-now-in-process sv-144 money-init-by-other arg0 s1-0 s0-0 (-> self entity)) - (set! sv-192 (-> sv-144 ppointer)) - v1-58 - ) - ) - sv-192 - ) + (set! v1-58 + (when sv-144 + (set! sv-192 (the-as (pointer process) v1-58)) + (let ((t9-20 (method-of-type money activate))) (t9-20 (the-as money sv-144) arg4 'money (the-as pointer #x70004000))) + (run-now-in-process sv-144 money-init-by-other arg0 s1-0 s0-0 (-> self entity)) + (set! sv-192 (-> sv-144 ppointer)) + v1-58)) + sv-192) ((= v1-25 (pickup-type fuel-cell)) (set! (-> s0-0 pickup-spawn-amount) arg2) (set! sv-160 (get-process *pickup-dead-pool* fuel-cell #x4000)) - (set! v1-64 (when sv-160 - (set! sv-192 (the-as (pointer process) v1-64)) - (let ((t9-23 (method-of-type fuel-cell activate))) - (t9-23 (the-as fuel-cell sv-160) arg4 'fuel-cell (the-as pointer #x70004000)) - ) - (run-now-in-process sv-160 fuel-cell-init-by-other arg0 s1-0 s0-0 (-> self entity)) - (set! sv-192 (-> sv-160 ppointer)) - v1-64 - ) - ) + (set! v1-64 + (when sv-160 + (set! sv-192 (the-as (pointer process) v1-64)) + (let ((t9-23 (method-of-type fuel-cell activate))) + (t9-23 (the-as fuel-cell sv-160) arg4 'fuel-cell (the-as pointer #x70004000))) + (run-now-in-process sv-160 fuel-cell-init-by-other arg0 s1-0 s0-0 (-> self entity)) + (set! sv-192 (-> sv-160 ppointer)) + v1-64)) (set! sv-48 0) - sv-48 - ) + sv-48) ((= v1-25 (pickup-type buzzer)) (set! (-> s0-0 pickup-spawn-amount) arg2) (set! sv-176 (get-process *pickup-dead-pool* buzzer #x4000)) - (set! v1-71 (when sv-176 - (set! sv-192 (the-as (pointer process) v1-71)) - (let ((t9-26 (method-of-type buzzer activate))) - (t9-26 (the-as buzzer sv-176) arg4 'buzzer (the-as pointer #x70004000)) - ) - (run-now-in-process sv-176 buzzer-init-by-other arg0 s1-0 s0-0 (-> self entity)) - (set! sv-192 (-> sv-176 ppointer)) - v1-71 - ) - ) + (set! v1-71 + (when sv-176 + (set! sv-192 (the-as (pointer process) v1-71)) + (let ((t9-26 (method-of-type buzzer activate))) (t9-26 (the-as buzzer sv-176) arg4 'buzzer (the-as pointer #x70004000))) + (run-now-in-process sv-176 buzzer-init-by-other arg0 s1-0 s0-0 (-> self entity)) + (set! sv-192 (-> sv-176 ppointer)) + v1-71)) (set! sv-48 0) - sv-48 - ) - (else - (format 0 "ERROR: unknown type of eco ~d~%" arg1) - #f - ) - ) - ) - ) - ) - ) - ) - sv-192 - ) + sv-48) + (else (format 0 "ERROR: unknown type of eco ~d~%" arg1) #f))))))) + sv-192) (defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) (let ((s3-0 (-> this pickup-type)) - (f30-0 (-> this pickup-amount)) - ) + (f30-0 (-> this pickup-amount))) (when (= s3-0 (pickup-type eco-pill-random)) f30-0 (let ((s1-0 (get-death-count *game-info* #f))) @@ -2480,106 +1528,69 @@ (cond ((and (= s1-0 1) *target* (and (>= 1.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.1)))) (set! s3-0 (pickup-type eco-green)) - 1.0 - ) + 1.0) ((and (< 1 s1-0) *target* (and (>= 2.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.05)))) (set! s3-0 (pickup-type eco-green)) - 1.0 - ) - ((< 20 *eco-pill-count*) - (return (the-as (pointer process) #f)) - f30-0 - ) - ((< 10 *eco-pill-count*) - 1.0 - ) + 1.0) + ((< 20 *eco-pill-count*) (return (the-as (pointer process) #f)) f30-0) + ((< 10 *eco-pill-count*) 1.0) ((type-type? (-> this type) fact-info-enemy) - (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3)) - ) - (else - (+ (rand-vu-float-range (the-as float 2.0) (+ 3.0 f30-0)) (the float arg3)) - ) - ) - ) - ) - ) + (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3))) + (else (+ (rand-vu-float-range (the-as float 2.0) (+ 3.0 f30-0)) (the float arg3))))))) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> this process root trans quad)) (+! (-> s2-1 y) 12288.0) (let ((s1-1 (new 'stack-no-clear 'collide-tri-result))) - (if (>= (fill-and-probe-using-y-probe - *collide-cache* - s2-1 - (the-as float 81920.0) - (collide-kind background) - (the-as process-drawable #f) - s1-1 - (new 'static 'pat-surface :noentity #x1) - ) - 0.0 - ) - (set! (-> s2-1 quad) (-> s1-1 intersect quad)) - (set! (-> s2-1 quad) (-> this process root trans quad)) - ) - ) - (if (= (the-as int s3-0) 6) - (+! (-> s2-1 y) 6144.0) - ) - (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 this) - ) - ) - ) + (if (>= (fill-and-probe-using-y-probe *collide-cache* + s2-1 + (the-as float 81920.0) + (collide-kind background) + (the-as process-drawable #f) + s1-1 + (new 'static 'pat-surface :noentity #x1)) + 0.0) + (set! (-> s2-1 quad) (-> s1-1 intersect quad)) + (set! (-> s2-1 quad) (-> this process root trans quad)))) + (if (= (the-as int s3-0) 6) (+! (-> s2-1 y) 6144.0)) + (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 this)))) (deftype ecovalve (process-drawable) - ((root collide-shape-moving :override) - (offset vector :inline) - (offset-target vector :inline) - (block-func (function vent symbol)) - ) + ((root collide-shape-moving :override) + (offset vector :inline) + (offset-target vector :inline) + (block-func (function vent symbol))) (:states - ecovalve-idle - ) - ) + ecovalve-idle)) - -(defskelgroup *ecovalve-sg* ecovalve ecovalve-geo-jg ecovalve-idle-ja - ((ecovalve-geo-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *ecovalve-sg* + ecovalve + ecovalve-geo-jg + ecovalve-idle-ja + ((ecovalve-geo-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) (defstate ecovalve-idle (ecovalve) - :code (behavior () - (transform-post) - (suspend) - (transform-post) - (loop - (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) - (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) - ) - (when (!= (-> self offset-target y) (-> self offset y)) - (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) - (move-to-point! (-> self root) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) - ) - (transform-post) - ) + :code + (behavior () + (transform-post) (suspend) - ) - ) - ) + (transform-post) + (loop (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) + (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0)) + (when (!= (-> self offset-target y) (-> self offset y)) + (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) + (move-to-point! (-> self root) + (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable (-> self parent 0)) root trans) (-> self offset))) + (transform-post)) + (suspend)))) (defbehavior ecovalve-init-by-other ecovalve ((arg0 (function vent symbol))) (stack-size-set! (-> self main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) - (set! (-> s5-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s5-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (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-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -2587,53 +1598,39 @@ (set! (-> s4-0 prim-core offense) (collide-offense touch)) (set! (-> s4-0 transform-index) 3) (set-vector! (-> s4-0 local-sphere) 0.0 3686.4 0.0 6144.0) - (set-root-prim! s5-0 s4-0) - ) + (set-root-prim! s5-0 s4-0)) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root) s5-0) - ) + (set! (-> self root) s5-0)) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (clear-collide-with-as (-> self root)) - ) + (clear-collide-with-as (-> self root))) (set! (-> self block-func) arg0) (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (set-vector! (-> self offset-target) 0.0 -2252.8 0.0 1.0) (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) - (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) - ) + (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0)) (set! (-> self offset quad) (-> self offset-target quad)) - (initialize-skeleton self *ecovalve-sg* '()) - (move-to-point! (-> self root) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) - ) + (initialize-skeleton self *ecovalve-sg* ()) + (move-to-point! (-> self root) + (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable (-> self parent 0)) root trans) (-> self offset))) (go ecovalve-idle) - (none) - ) + (none)) (deftype vent (process-drawable) - ((root collide-shape :override) - (show-particles symbol) - (collect-effect sparticle-launch-group) - (collect-effect2 sparticle-launch-group) - (collect-effect-time time-frame) - (blocker entity-actor) - (block-func (function vent symbol)) - (pickup-handle handle) - ) + ((root collide-shape :override) + (show-particles symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (blocker entity-actor) + (block-func (function vent symbol)) + (pickup-handle handle)) (:methods - (initialize (_type_ entity-actor pickup-type) none) - ) + (initialize (_type_ entity-actor pickup-type) none)) (:states - vent-blocked - (vent-pickup handle) - vent-wait-for-touch - ) - ) - + vent-blocked + (vent-pickup handle) + vent-wait-for-touch)) (defmethod initialize ((this vent) (arg0 entity-actor) (arg1 pickup-type)) (stack-size-set! (-> this main-thread) 128) @@ -2643,12 +1640,10 @@ (set! (-> s2-0 prim-core collide-as) (collide-kind powerup)) (set! (-> s2-0 collide-with) (collide-kind target)) (set-vector! (-> s2-0 local-sphere) 0.0 4915.2 0.0 6553.6) - (set-root-prim! s3-0 s2-0) - ) + (set-root-prim! s3-0 s2-0)) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> this root) s3-0) - ) + (set! (-> this root) s3-0)) (set! (-> this root trans quad) (-> arg0 extra trans quad)) (update-transforms! (-> this root)) (set! (-> this root pause-adjust-distance) 409600.0) @@ -2659,220 +1654,141 @@ (set! (-> this part) (create-launch-control (-> *part-group-id-table* 44) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 67)) (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root trans))) - ) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root trans)))) (((pickup-type eco-red)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 50) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 69)) (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root trans))) - ) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root trans)))) (((pickup-type eco-green)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 62) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 66)) (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root trans))) - ) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root trans)))) (((pickup-type eco-yellow)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 52) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 68)) (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root trans))) - ) - ) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root trans))))) (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (when (-> this blocker) (logior! (-> this fact options) (fact-options vent-blocked)) (set! (-> this block-func) - (lambda ((arg0 vent)) (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status complete)))) - ) - ) + (lambda ((arg0 vent)) + (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status complete)))))) (set! (-> this show-particles) #t) (when (logtest? (-> this fact options) (fact-options vent-blocked)) (when (logtest? (-> this fact options) (fact-options vent-valve)) (case (-> this fact pickup-type) (((pickup-type eco-blue)) (set! (-> this block-func) - (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task jungle-eggtop))))) - ) - ) + (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task jungle-eggtop))))))) (((pickup-type eco-red)) (set! (-> this block-func) - (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task red-eggtop))))) - ) - ) + (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task red-eggtop))))))) (((pickup-type eco-yellow)) (set! (-> this block-func) - (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task snow-eggtop))))) - ) - ) - ) - (process-spawn ecovalve (-> this block-func) :from *pickup-dead-pool* :to this) - ) - (if ((-> this block-func) this) - (go vent-blocked) - ) - ) + (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task snow-eggtop)))))))) + (process-spawn ecovalve (-> this block-func) :from *pickup-dead-pool* :to this)) + (if ((-> this block-func) this) (go vent-blocked))) (go vent-wait-for-touch) - (none) - ) + (none)) (defbehavior vent-standard-event-handler vent ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('show-particles) - (let ((v0-0 (the-as object (-> arg3 param 0)))) - (set! (-> self show-particles) (the-as symbol v0-0)) - v0-0 - ) - ) - (('hide) - (set! (-> self block-func) (the-as (function vent symbol) true-func)) - (go vent-blocked) - ) - ) - ) + (let ((v0-0 (the-as object (-> arg3 param 0)))) (set! (-> self show-particles) (the-as symbol v0-0)) v0-0)) + (('hide) (set! (-> self block-func) (the-as (function vent symbol) true-func)) (go vent-blocked)))) (defstate vent-wait-for-touch (vent) - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (if (and (or (= message 'touch) (= message 'attack)) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'get-pickup) - (set! (-> a1-1 param 0) (the-as uint (-> self fact pickup-type))) - (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-amount))) - (and (= (send-event-function proc a1-1) #t) - (or (logtest? (-> self fact options) (fact-options powerup)) (send-event proc 'powerup)) - ) - ) - ) - (go vent-pickup (process->handle proc)) - ) - (vent-standard-event-handler proc argc message block) - ) - :code (behavior () - (loop - (let ((a0-0 (-> self part)) - (a1-0 (-> self root trans)) - (gp-0 (-> self sound)) - ) - (if (and (nonzero? a0-0) (-> self show-particles)) - (spawn a0-0 a1-0) - ) - (if (nonzero? gp-0) - (update! gp-0) - ) - ) - (suspend) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (or (= message 'touch) (= message 'attack)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'get-pickup) + (set! (-> a1-1 param 0) (the-as uint (-> self fact pickup-type))) + (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-amount))) + (and (= (send-event-function proc a1-1) #t) + (or (logtest? (-> self fact options) (fact-options powerup)) (send-event proc 'powerup))))) + (go vent-pickup (process->handle proc))) + (vent-standard-event-handler proc argc message block)) + :code + (behavior () + (loop (let ((a0-0 (-> self part)) + (a1-0 (-> self root trans)) + (gp-0 (-> self sound))) + (if (and (nonzero? a0-0) (-> self show-particles)) (spawn a0-0 a1-0)) + (if (nonzero? gp-0) (update! gp-0))) + (suspend)))) (defstate vent-blocked (vent) - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('show) - (go vent-wait-for-touch) - ) - ) - ) - :code (behavior () - (loop - (if (not ((-> self block-func) self)) - (go vent-wait-for-touch) - ) - (suspend) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('show) (go vent-wait-for-touch)))) + :code + (behavior () + (loop (if (not ((-> self block-func) self)) (go vent-wait-for-touch)) + (suspend)))) (defstate vent-pickup (vent) :event vent-standard-event-handler - :code (behavior ((arg0 handle)) - (when (-> self show-particles) - (when (nonzero? (-> self collect-effect)) - (let* ((s5-0 (handle->process arg0)) - (gp-0 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) - s5-0 - ) - ) - ) - (when gp-0 - (let* ((s4-0 (-> (the-as process-drawable gp-0) root)) - (s5-1 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) collide-shape)) - s4-0 - ) - ) - ) - (when s5-1 - (process-spawn - part-tracker - :init part-tracker-init - (-> self collect-effect) - -1 - part-tracker-track-target - #f - #f - (-> (the-as collide-shape s5-1) root-prim prim-core) - :to gp-0 - ) - (process-spawn - part-tracker - :init part-tracker-init - (-> self collect-effect2) - -1 - part-tracker-move-to-target - #f - #f - (-> self root root-prim prim-core) - :to self - ) - ) - ) - ) - ) - ) - ) - (go vent-wait-for-touch) - ) - ) - -(deftype ventyellow (vent) - () - ) + :code + (behavior ((arg0 handle)) + (when (-> self show-particles) + (when (nonzero? (-> self collect-effect)) + (let* ((s5-0 (handle->process arg0)) + (gp-0 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0))) + (when gp-0 + (let* ((s4-0 (-> (the-as process-drawable gp-0) root)) + (s5-1 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) collide-shape)) s4-0))) + (when s5-1 + (process-spawn part-tracker + :init + part-tracker-init + (-> self collect-effect) + -1 + part-tracker-track-target + #f + #f + (-> (the-as collide-shape s5-1) root-prim prim-core) + :to + gp-0) + (process-spawn part-tracker + :init + part-tracker-init + (-> self collect-effect2) + -1 + part-tracker-move-to-target + #f + #f + (-> self root root-prim prim-core) + :to + self))))))) + (go vent-wait-for-touch))) +(deftype ventyellow (vent) ()) (defmethod init-from-entity! ((this ventyellow) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-yellow)) - (none) - ) - -(deftype ventred (vent) - () - ) + (none)) +(deftype ventred (vent) ()) (defmethod init-from-entity! ((this ventred) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-red)) - (none) - ) - -(deftype ventblue (vent) - () - ) + (none)) +(deftype ventblue (vent) ()) (defmethod init-from-entity! ((this ventblue) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) - (none) - ) - -(deftype ecovent (vent) - () - ) + (none)) +(deftype ecovent (vent) ()) (defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) - (none) - ) + (none)) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index f3cf77d864..eea7dd6cd8 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -1,7 +1,6 @@ ;;-*-Lisp-*- (in-package goal) (bundles "ENGINE.CGO" "GAME.CGO") - (require "engine/common-obs/collectables.gc") ;; name: crates.gc @@ -9,968 +8,732 @@ ;; dgos: GAME, ENGINE (declare-type crate process-drawable) + (declare-type crate-buzzer crate) ;; DECOMP BEGINS -(defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja - ((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *crate-barrel-sg* + crate + crate-barrel-lod0-jg + crate-barrel-idle-ja + ((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) -(defskelgroup *crate-bucket-sg* crate crate-bucket-lod0-jg crate-bucket-idle-ja - ((crate-bucket-lod0-mg (meters 999999))) - :bounds (static-spherem 0 0 0 4) - :texture-level 2 - ) +(defskelgroup *crate-bucket-sg* + crate + crate-bucket-lod0-jg + crate-bucket-idle-ja + ((crate-bucket-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 2) -(defskelgroup *crate-wood-sg* crate crate-wood-lod0-jg crate-idle-ja - ((crate-wood-lod0-mg (meters 20)) (crate-wood-lod1-mg (meters 40)) (crate-wood-lod2-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *crate-wood-sg* + crate + crate-wood-lod0-jg + crate-idle-ja + ((crate-wood-lod0-mg (meters 20)) (crate-wood-lod1-mg (meters 40)) (crate-wood-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) -(defskelgroup *crate-iron-sg* crate crate-iron-lod0-jg crate-idle-ja - ((crate-iron-lod0-mg (meters 20)) (crate-iron-lod1-mg (meters 40)) (crate-iron-lod2-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *crate-iron-sg* + crate + crate-iron-lod0-jg + crate-idle-ja + ((crate-iron-lod0-mg (meters 20)) (crate-iron-lod1-mg (meters 40)) (crate-iron-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) -(defskelgroup *crate-steel-sg* crate crate-steel-lod0-jg crate-idle-ja - ((crate-steel-lod0-mg (meters 20)) (crate-steel-lod1-mg (meters 40)) (crate-steel-lod2-mg (meters 999999))) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *crate-steel-sg* + crate + crate-steel-lod0-jg + crate-idle-ja + ((crate-steel-lod0-mg (meters 20)) (crate-steel-lod1-mg (meters 40)) (crate-steel-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) -(defskelgroup *crate-darkeco-sg* crate crate-darkeco-lod0-jg crate-idle-ja - ((crate-darkeco-lod0-mg (meters 20)) - (crate-darkeco-lod1-mg (meters 40)) - (crate-darkeco-lod2-mg (meters 999999)) - ) - :bounds (static-spherem 0 1 0 1.6) - :texture-level 2 - ) +(defskelgroup *crate-darkeco-sg* + crate + crate-darkeco-lod0-jg + crate-idle-ja + ((crate-darkeco-lod0-mg (meters 20)) (crate-darkeco-lod1-mg (meters 40)) (crate-darkeco-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.6) + :texture-level 2) (deftype crate-bank (basic) - ((COLLIDE_YOFF float) - (COLLIDE_RADIUS float) - (DARKECO_EXPLODE_RADIUS float) - ) - ) - + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float))) (define *CRATE-bank* - (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 4915.2 :DARKECO_EXPLODE_RADIUS 16384.0) - ) + (new 'static 'crate-bank :COLLIDE_YOFF 4096.0 :COLLIDE_RADIUS 4915.2 :DARKECO_EXPLODE_RADIUS 16384.0)) (deftype crate (process-drawable) - ((root collide-shape-moving :override) - (smush smush-control :inline) - (base vector :inline) - (look symbol) - (defense symbol) - (incomming-attack-id uint64) - (target handle) - (child-count int32) - (victory-anim spool-anim) - ) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incomming-attack-id uint64) + (target handle) + (child-count int32) + (victory-anim spool-anim)) (:state-methods - wait - (die symbol int) - special-contents-die - bounce-on - (notice-blue handle) - ) + wait + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle)) (:methods - (params-init (_type_ entity) none) - (art-init (_type_) crate) - (params-set! (_type_ symbol symbol) none) - (check-dead (_type_) none) - (smush-update! (_type_) none) - ) - ) - + (params-init (_type_ entity) none) + (art-init (_type_) crate) + (params-set! (_type_ symbol symbol) none) + (check-dead (_type_) none) + (smush-update! (_type_) none))) (method-set! crate 12 (method-of-type process run-logic?)) (defbehavior crate-post crate () (rider-trans) (smush-update! self) - (rider-post) - ) + (rider-post)) (defpart 281 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 16.0) - (:y (meters 0.5) (meters 1)) - (:scale-x (meters 1.5) (meters 1.5)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0 32.0) - (:g 128.0 32.0) - (:b 128.0 32.0) - (:a 32.0 16.0) - (:vel-y (meters 0.016666668) (meters 0.033333335)) - (:rotvel-z (degrees -1.2) (degrees 1.2)) - (:accel-y (meters 0.00066666666)) - (:timer (seconds 0.4)) - (:flags (bit2 bit12 bit14)) - (:next-time (seconds 0.1) (seconds 0.197)) - (:next-launcher 282) - (:conerot-x (degrees 70) (degrees 20)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 16.0) + (:y (meters 0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 32.0) + (:g 128.0 32.0) + (:b 128.0 32.0) + (:a 32.0 16.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1.2) (degrees 1.2)) + (:accel-y (meters 0.00066666666)) + (:timer (seconds 0.4)) + (:flags (bit2 bit12 bit14)) + (:next-time (seconds 0.1) (seconds 0.197)) + (:next-launcher 282) + (:conerot-x (degrees 70) (degrees 20)) + (:conerot-y (degrees 0) (degrees 360)))) (defpart 282 - :init-specs ((:fade-a -1.0666667)) - ) + :init-specs ((:fade-a -1.0666667))) (defpart 283 - :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #x2)) - (:num 4.0) - (:y (meters 0.75)) - (:scale-x (meters 6)) - (:rot-x 4) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.3) (meters 1)) - (:r 192.0) - (:g 192.0) - (:b 64.0 128.0) - (:a 0.0) - (:scalevel-x (meters 0.009765625)) - (:rotvel-z (degrees -0.15) (degrees 0.3)) - (:scalevel-y (meters 0.009765625)) - (:fade-a 2.1333334) - (:timer (seconds 0.1)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.05)) - (:next-launcher 284) - (:rotate-y (degrees 0)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x2 :page #x2)) (:num 4.0) + (:y (meters 0.75)) + (:scale-x (meters 6)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 192.0) + (:g 192.0) + (:b 64.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 0.1)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.05)) + (:next-launcher 284) + (:rotate-y (degrees 0)))) (defpart 284 - :init-specs ((:fade-a -2.1333334)) - ) + :init-specs ((:fade-a -2.1333334))) (defpart 285 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:y (meters 1)) - (:scale-x (meters 8)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 196.0) - (:g 196.0) - (:b 196.0) - (:a 28.0) - (:timer (seconds 0.035)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 196.0) + (:b 196.0) + (:a 28.0) + (:timer (seconds 0.035)) + (:flags (bit2 bit3 bit14)))) (defpart 286 - :init-specs ((:texture (new 'static 'texture-id :index #x6 :page #x2)) - (:num 5.0) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.25) (meters 1.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 0.6) 2.0 (meters 0.6)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.3)) - (:r 160.0) - (:g 160.0) - (:b 160.0) - (:a 128.0) - (:vel-y (meters 0.06666667) (meters 0.06666667)) - (:rotvel-x (degrees 1.2)) - (:rotvel-y (degrees 2.4)) - (:rotvel-z (degrees 0) 2 (degrees 2.4)) - (:accel-y (meters -0.0033333334)) - (:friction 0.97) - (:timer (seconds 0.5)) - (:flags (bit2 bit12 bit14)) - (:next-time (seconds 0.25)) - (:next-launcher 287) - (:conerot-x (degrees 40) (degrees 30)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x6 :page #x2)) (:num 5.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.6) 2.0 (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 2 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (bit2 bit12 bit14)) + (:next-time (seconds 0.25)) + (:next-launcher 287) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)))) (defpart 287 - :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) - ) + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4))) (defpart 288 - :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x2)) - (:num 4.5) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.25) (meters 1.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 0.3) 1 (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.3)) - (:r 100.0) - (:g 100.0) - (:b 100.0) - (:a 128.0) - (:vel-y (meters 0.06666667) (meters 0.06666667)) - (:rotvel-x (degrees 1.2)) - (:rotvel-y (degrees 2.4)) - (:rotvel-z (degrees 0) 3 (degrees 2.4)) - (:accel-y (meters -0.0033333334)) - (:friction 0.97) - (:timer (seconds 0.5)) - (:flags (bit2 bit12 bit14)) - (:next-time (seconds 0.25)) - (:next-launcher 287) - (:conerot-x (degrees 40) (degrees 30)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x5 :page #x2)) (:num 4.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 100.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (bit2 bit12 bit14)) + (:next-time (seconds 0.25)) + (:next-launcher 287) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)))) (defpartgroup group-crate-explode :id 71 :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) - ) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288))) (defpartgroup group-crate-steel-explode :id 72 :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) - ) + :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288))) (defpartgroup group-dark-eco-box-explosion :id 73 :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) - :parts ((sp-item 295 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 296) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 296 :flags (start-dead launch-asap) :binding 297) - (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) - (sp-item 292 :fade-after (meters 160) :period (seconds 2) :length (seconds 0.017)) - (sp-item 2095 :period (seconds 2) :length (seconds 0.017)) - (sp-item 2096 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) - (sp-item 2097 :period (seconds 2) :length (seconds 0.067)) - (sp-item 2098 :fade-after (meters 120) :falloff-to (meters 120) :period (seconds 2) :length (seconds 0.067)) - ) - ) + :parts + ((sp-item 295 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 296) (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 296 :flags (start-dead launch-asap) :binding 297) + (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 292 :fade-after (meters 160) :period (seconds 2) :length (seconds 0.017)) + (sp-item 2095 :period (seconds 2) :length (seconds 0.017)) + (sp-item 2096 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) + (sp-item 2097 :period (seconds 2) :length (seconds 0.067)) + (sp-item 2098 :fade-after (meters 120) :falloff-to (meters 120) :period (seconds 2) :length (seconds 0.067)))) (defpart 2096 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 6.0) - (:scale-x (meters 0.2) (meters 0.4)) - (:scale-y :copy scale-x) - (:r 64.0 128.0) - (:g 0.0 32.0) - (:b 96.0 64.0) - (:a 32.0 96.0) - (:vel-y (meters 0.026666667) (meters 0.10666667)) - (:scalevel-x (meters -0.0016666667)) - (:scalevel-y :copy scalevel-x) - (:accel-y (meters -0.00016666666) (meters -0.00016666666)) - (:friction 0.9) - (:timer (seconds 1)) - (:flags (bit2 bit14)) - (:next-time (seconds 0.1) (seconds 0.097)) - (:next-launcher 2099) - (:conerot-x (degrees 0) (degrees 140)) - (:conerot-y (degrees 0) (degrees 360)) - (:conerot-radius (meters 2) (meters 4)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 6.0) + (:scale-x (meters 0.2) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 96.0 64.0) + (:a 32.0 96.0) + (:vel-y (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (bit2 bit14)) + (:next-time (seconds 0.1) (seconds 0.097)) + (:next-launcher 2099) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 2) (meters 4)))) (defpart 2099 - :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -1.4222223)) - ) + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -1.4222223))) (defpart 2098 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 3.0) - (:scale-x (meters 0.2)) - (:rot-z (degrees 0) (degrees 180)) - (:scale-y (meters 8)) - (:r 64.0 192.0) - (:g 0.0 32.0) - (:b 128.0 64.0) - (:a 32.0 64.0) - (:scalevel-y (meters 0.42666668)) - (:fade-a -1.6) - (:timer (seconds 0.2)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 3.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 180)) + (:scale-y (meters 8)) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 32.0 64.0) + (:scalevel-y (meters 0.42666668)) + (:fade-a -1.6) + (:timer (seconds 0.2)) + (:flags (bit2 bit3 bit14)))) (defpart 2095 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 1.0) - (:scale-x (meters 16)) - (:scale-y :copy scale-x) - (:r 64.0 192.0) - (:g 0.0 32.0) - (:b 128.0 64.0) - (:a 96.0) - (:fade-a -1.7454545) - (:timer (seconds 0.18)) - (:flags (bit2 bit3 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 1.0) + (:scale-x (meters 16)) + (:scale-y :copy scale-x) + (:r 64.0 192.0) + (:g 0.0 32.0) + (:b 128.0 64.0) + (:a 96.0) + (:fade-a -1.7454545) + (:timer (seconds 0.18)) + (:flags (bit2 bit3 bit14)))) (defpart 2097 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 4.0) - (:scale-x (meters 2.5) (meters 1.5)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 0.0 96.0) - (:g 0.0 32.0) - (:b 64.0 32.0) - (:a 64.0 64.0) - (:vel-y (meters 0.053333335) (meters 0.013333334)) - (:scalevel-x (meters 0.013333334)) - (:rotvel-z (degrees -0.3) (degrees 0.6)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.42666668) - (:accel-y (meters 0.00016666666) (meters 0.00016666666)) - (:friction 0.8) - (:timer (seconds 1.7)) - (:flags (bit2 bit14)) - (:conerot-x (degrees 0) (degrees 110)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 4.0) + (:scale-x (meters 2.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.053333335) (meters 0.013333334)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.8) + (:timer (seconds 1.7)) + (:flags (bit2 bit14)) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 360)))) (defpart 295 - :init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2)) - (:num 16.0) - (:y (meters 1)) - (:scale-x (meters 0.1)) - (:scale-y :copy scale-x) - (:a 0.0) - (:vel-y (meters 0.053333335) (meters 0.026666667)) - (:accel-y (meters -0.00033333333)) - (:friction 0.94) - (:timer (seconds 0.8)) - (:flags (bit3 bit14)) - (:conerot-x (degrees 0) (degrees 140)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x12 :page #x2)) (:num 16.0) + (:y (meters 1)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:a 0.0) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:accel-y (meters -0.00033333333)) + (:friction 0.94) + (:timer (seconds 0.8)) + (:flags (bit3 bit14)) + (:conerot-x (degrees 0) (degrees 140)) + (:conerot-y (degrees 0) (degrees 360)))) (defpart 296 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:y (meters 0) (meters 16)) - (:z (meters 0.3) (meters 0.3)) - (:scale-x (meters 0.3) (meters 0.3)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 0.0 96.0) - (:g 0.0 32.0) - (:b 64.0 32.0) - (:a 64.0 64.0) - (:omega 0.0 65536.0) - (:vel-x (meters 0.026666667) (meters 0.10666667)) - (:scalevel-x (meters -0.000909091)) - (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) - (:scalevel-y :copy scalevel-x) - (:fade-g -0.26666668) - (:fade-a -0.19393939) - (:timer (seconds 0.3) (seconds 0.497)) - (:flags (bit2 bit3 bit7 bit14)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 64.0 64.0) + (:omega 0.0 65536.0) + (:vel-x (meters 0.026666667) (meters 0.10666667)) + (:scalevel-x (meters -0.000909091)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-a -0.19393939) + (:timer (seconds 0.3) (seconds 0.497)) + (:flags (bit2 bit3 bit7 bit14)))) (defpart 297 - :init-specs ((:texture (new 'static 'texture-id :index #xf :page #x2)) - (:num 1.0) - (:scale-x (meters 0.3) (meters 0.1)) - (:scale-y :copy scale-x) - (:r 32.0 96.0) - (:g 0.0 32.0) - (:b 64.0 32.0) - (:a 32.0 32.0) - (:scalevel-x (meters -0.0006190476)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.01904762) - (:accel-y (meters -0.000100000005) (meters -0.00015)) - (:timer (seconds 0.1) (seconds 0.997)) - (:flags (bit2 bit3 bit14)) - (:next-time (seconds 0.8)) - (:next-launcher 198) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #xf :page #x2)) (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g 0.0 32.0) + (:b 64.0 32.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (bit2 bit3 bit14)) + (:next-time (seconds 0.8)) + (:next-launcher 198))) (defpart 292 - :init-specs ((:texture (new 'static 'texture-id :index #x5 :page #x2)) - (:num 8.0 16.0) - (:x (meters -0.5) (meters 1)) - (:y (meters 0.25) (meters 1.5)) - (:z (meters -0.5) (meters 1)) - (:scale-x (meters 0.3) 1 (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y (meters 0.3)) - (:r 128.0) - (:g 64.0 1 32.0) - (:b 32.0) - (:a 128.0) - (:vel-y (meters 0.06666667) (meters 0.06666667)) - (:rotvel-x (degrees 1.2)) - (:rotvel-y (degrees 2.4)) - (:rotvel-z (degrees 0) 3 (degrees 2.4)) - (:accel-y (meters -0.0033333334)) - (:friction 0.97) - (:timer (seconds 0.5)) - (:flags (bit2 bit12 bit14)) - (:next-time (seconds 0.25)) - (:next-launcher 301) - (:conerot-x (degrees 40) (degrees 30)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) + :init-specs + ((:texture (new 'static 'texture-id :index #x5 :page #x2)) (:num 8.0 16.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.25) (meters 1.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.3) 1 (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3)) + (:r 128.0) + (:g 64.0 1 32.0) + (:b 32.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-x (degrees 1.2)) + (:rotvel-y (degrees 2.4)) + (:rotvel-z (degrees 0) 3 (degrees 2.4)) + (:accel-y (meters -0.0033333334)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (bit2 bit12 bit14)) + (:next-time (seconds 0.25)) + (:next-launcher 301) + (:conerot-x (degrees 40) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)))) (defpart 301 - :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4)) - ) + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -3.4))) (defbehavior crate-standard-event-handler crate ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) (let ((s4-0 (-> arg3 param 2)) - (s5-0 (-> arg3 param 3)) - ) + (s5-0 (-> arg3 param 3))) (case (-> self defense) (('iron) (case (-> arg3 param 1) (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) (if (and (logtest? (-> self fact options) (fact-options require-zoomer)) *target* - (not (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - ) - (return #f) - ) + (not (logtest? (-> *target* control root-prim prim-core action) (collide-action racer)))) + (return #f)) (increment-success-for-hint (text-id sidekick-hint-crate-iron)) (increment-success-for-hint (text-id training-ironcrate)) (send-event arg0 'get-attack-count 1) - (go-virtual die #f (the-as int s5-0)) - ) + (go-virtual die #f (the-as int s5-0))) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) - (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) - ) - (level-hint-spawn (text-id training-ironcrate) "sagevb36" (the-as entity #f) *entity-pool* (game-task none)) - ) - (case (-> (level-get-target-inside *level*) name) - (('training) - (if (and (can-hint-be-played? (text-id zero) (the-as entity #f) (the-as string #f)) (rand-vu-percent? 0.2)) - (clear-text-seen! *game-info* (text-id sidekick-hint-crate-iron)) - ) - ) - ) - (level-hint-spawn - (text-id sidekick-hint-crate-iron) - "sksp0005" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self incomming-attack-id) s4-0) - (if (not (!= (-> self smush amp) 0.0)) - (sound-play "icrate-nobreak") - ) - (activate! (-> self smush) 0.1 90 150 1.0 1.0) - (go-virtual bounce-on) - ) - #f - ) - ) - ) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) + (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese)))) + (level-hint-spawn (text-id training-ironcrate) "sagevb36" (the-as entity #f) *entity-pool* (game-task none))) + (case (-> (level-get-target-inside *level*) name) + (('training) + (if (and (can-hint-be-played? (text-id zero) (the-as entity #f) (the-as string #f)) (rand-vu-percent? 0.2)) + (clear-text-seen! *game-info* (text-id sidekick-hint-crate-iron))))) + (level-hint-spawn (text-id sidekick-hint-crate-iron) "sksp0005" (the-as entity #f) *entity-pool* (game-task none)) + (set! (-> self incomming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) (sound-play "icrate-nobreak")) + (activate! (-> self smush) 0.1 90 150 1.0 1.0) + (go-virtual bounce-on)) + #f))) (('steel) (case (-> arg3 param 1) (('explode 'darkeco 'eco-yellow 'bonk 'tube 'flut-bonk 'flut-attack 'racer) (send-event arg0 'get-attack-count 1) (when (logtest? (-> self draw status) (draw-status was-drawn)) (increment-success-for-hint (text-id sidekick-hint-crate-steel)) - (level-hint-spawn - (text-id sidekick-hint-crate-steel-break1) - "sksp0004" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (level-hint-spawn - (text-id sidekick-hint-crate-steel-break2) - "sksp009b" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - (go-virtual die #f (the-as int s5-0)) - ) + (level-hint-spawn (text-id sidekick-hint-crate-steel-break1) + "sksp0004" + (the-as entity #f) + *entity-pool* + (game-task none)) + (level-hint-spawn (text-id sidekick-hint-crate-steel-break2) + "sksp009b" + (the-as entity #f) + *entity-pool* + (game-task none))) + (go-virtual die #f (the-as int s5-0))) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) - (level-hint-spawn - (text-id sidekick-hint-crate-steel) - "sksp0006" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (set! (-> self incomming-attack-id) s4-0) - (if (not (!= (-> self smush amp) 0.0)) - (sound-play "scrate-nobreak") - ) - (activate! (-> self smush) 0.1 90 150 1.0 1.0) - (go-virtual bounce-on) - ) - #f - ) - ) - ) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) + (level-hint-spawn (text-id sidekick-hint-crate-steel) "sksp0006" (the-as entity #f) *entity-pool* (game-task none)) + (set! (-> self incomming-attack-id) s4-0) + (if (not (!= (-> self smush amp) 0.0)) (sound-play "scrate-nobreak")) + (activate! (-> self smush) 0.1 90 150 1.0 1.0) + (go-virtual bounce-on)) + #f))) (('darkeco) (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (when (= (-> arg0 type) target) - (level-hint-spawn - (text-id sidekick-hint-crate-darkeco2) - "sksp009c" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (level-hint-spawn - (text-id sidekick-hint-crate-darkeco1) - "sksp0002" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (text-id sidekick-hint-crate-darkeco2) "sksp009c" (the-as entity #f) *entity-pool* (game-task none)) + (level-hint-spawn (text-id sidekick-hint-crate-darkeco1) "sksp0002" (the-as entity #f) *entity-pool* (game-task none)) (case (-> (level-get-target-inside *level*) name) (('rolling) - (level-hint-spawn - (text-id sidekick-hint-crate-darkeco-rolling) - "sksp0110" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) + (level-hint-spawn (text-id sidekick-hint-crate-darkeco-rolling) + "sksp0110" + (the-as entity #f) + *entity-pool* + (game-task none))) (('firecanyon) - (level-hint-spawn - (text-id firecanyon-crate-darkeco2) - "sksp0082" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - (level-hint-spawn - (text-id firecanyon-crate-darkeco1) - "sksp0081" - (the-as entity #f) - *entity-pool* - (game-task none) - ) - ) - ) - ) - (go-virtual die #f (the-as int s5-0)) - ) - (else - (send-event arg0 'get-attack-count 1) - (go-virtual die #f (the-as int s5-0)) - ) - ) - ) - ) + (level-hint-spawn (text-id firecanyon-crate-darkeco2) "sksp0082" (the-as entity #f) *entity-pool* (game-task none)) + (level-hint-spawn (text-id firecanyon-crate-darkeco1) "sksp0081" (the-as entity #f) *entity-pool* (game-task none))))) + (go-virtual die #f (the-as int s5-0))) + (else (send-event arg0 'get-attack-count 1) (go-virtual die #f (the-as int s5-0)))))) (('touch) (case (-> self defense) - (('darkeco) - (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) - (go-virtual die #f 0) - ) - ) - ) + (('darkeco) (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco)))) (go-virtual die #f 0)))) (('bonk) (when (= (-> self root trans y) (-> self base y)) (activate! (-> self smush) -0.1 75 150 1.0 1.0) - (go-virtual bounce-on) - ) - ) + (go-virtual bounce-on))) (('wake) (let ((v0-0 (the-as object (logclear (-> self mask) (process-mask sleep))))) (set! (-> self mask) (the-as process-mask v0-0)) - v0-0 - ) - ) + v0-0)) (('eco-blue) (if (not (or (= (-> self defense) 'darkeco) (or (= (-> self next-state name) 'notice-blue) (= (-> self next-state name) 'die)) - (!= (-> self root trans y) (-> self base y)) - ) - ) - (go-virtual notice-blue (process->handle arg0)) - ) - ) - ) - ) + (!= (-> self root trans y) (-> self base y)))) + (go-virtual notice-blue (process->handle arg0)))))) (defstate wait (crate) :virtual #t :event crate-standard-event-handler - :code (behavior () - (suspend) - (update-transforms! (-> self root)) - (logior! (-> self mask) (process-mask sleep)) - (loop + :code + (behavior () (suspend) - ) - ) - :post ja-post - ) + (update-transforms! (-> self root)) + (logior! (-> self mask) (process-mask sleep)) + (loop (suspend))) + :post ja-post) (defstate bounce-on (crate) :virtual #t :event crate-standard-event-handler - :code (behavior () - (while (!= (-> self smush amp) 0.0) - (suspend) - ) - (go-virtual wait) - ) - :post crate-post - ) + :code + (behavior () + (while (!= (-> self smush amp) 0.0) + (suspend)) + (go-virtual wait)) + :post crate-post) (defstate notice-blue (crate) :virtual #t :event crate-standard-event-handler - :trans (behavior () - (cond - ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) - (logior! (-> self mask) (process-mask sleep-code)) - (if (not (!= (-> self smush amp) 0.0)) - (go-virtual wait) - ) - ) - (else - (logclear! (-> self mask) (process-mask sleep-code)) - ) - ) - ) - :code (behavior ((arg0 handle)) - (set! (-> self target) arg0) - (loop - (let* ((gp-0 (handle->process (-> self target))) - (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) - gp-0 - ) - ) - ) - (when v1-4 - (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) - (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) - gp-1 - ) - ) - ) - (when v1-6 - (let* ((gp-2 (-> self root root-prim prim-core)) - (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) - (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3))) - ) - (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) - (logior! (-> self fact options) (fact-options can-collect)) - (go-virtual die #f 0) - ) - (when (rand-vu-percent? 0.5) - (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-2 world-sphere quad)) - (dotimes (gp-3 3) - (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8)) - ) - (eco-blue-glow s5-0) - ) - ) - (activate! - (-> self smush) - (lerp-scale - (rand-vu-float-range 0.1 0.3) - (rand-vu-float-range 0.0 0.02) - f30-0 - (-> *FACT-bank* suck-suck-dist) - (-> *FACT-bank* suck-bounce-dist) - ) - 60 - 60 - 1.0 - 1.0 - ) - ) - ) - ) - ) - ) - (suspend) - ) - ) - :post crate-post - ) + :trans + (behavior () + (cond + ((not (send-event *target* 'query 'powerup (pickup-type eco-blue))) + (logior! (-> self mask) (process-mask sleep-code)) + (if (not (!= (-> self smush amp) 0.0)) (go-virtual wait))) + (else (logclear! (-> self mask) (process-mask sleep-code))))) + :code + (behavior ((arg0 handle)) + (set! (-> self target) arg0) + (loop (let* ((gp-0 (handle->process (-> self target))) + (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) + (when v1-4 + (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) + (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) + (when v1-6 + (let* ((gp-2 (-> self root root-prim prim-core)) + (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) + (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3)))) + (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) + (logior! (-> self fact options) (fact-options can-collect)) + (go-virtual die #f 0)) + (when (rand-vu-percent? 0.5) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> gp-2 world-sphere quad)) + (dotimes (gp-3 3) + (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8))) + (eco-blue-glow s5-0))) + (activate! (-> self smush) + (lerp-scale (rand-vu-float-range 0.1 0.3) + (rand-vu-float-range 0.0 0.02) + f30-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist)) + 60 + 60 + 1.0 + 1.0)))))) + (suspend))) + :post crate-post) (defstate die (crate) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('touched) - (case (-> self defense) - (('darkeco) - (cond - ((= (-> proc type) target) - (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco)))) - ) - (else - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 4) - (set! (-> a1-5 message) 'attack) - (set! (-> a1-5 param 0) (-> block param 0)) - (set! (-> a1-5 param 1) (the-as uint 'darkeco)) - (let ((v1-12 (+ *global-attack-id* 1))) - (set! *global-attack-id* v1-12) - (set! (-> a1-5 param 2) (the-as uint v1-12)) - ) - (set! (-> a1-5 param 3) (the-as uint 0)) - (send-event-function proc a1-5) - ) - ) - ) - ) - ) - ) - ) - ) - :trans (behavior () - (case (-> self type) - ((crate-buzzer) - (if (and *target* (>= (-> *target* fact buzzer) 6.0)) - (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) - ) - ) - ) - ) - :code (behavior ((arg0 symbol) (arg1 int)) - (clear-collide-with-as (-> self root)) - (if (nonzero? (-> self sound)) - (stop! (-> self sound)) - ) - (if (and *target* - (and (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut)) - (!= (-> self fact pickup-type) 6) - (not arg0) - ) - ) - (logior! (-> self fact options) (fact-options instant-collect)) - ) - (when (not arg0) - (let ((s5-1 (current-time))) - (until (time-elapsed? s5-1 (seconds 0.04)) - (suspend) - ) - ) - (logior! (-> self draw status) (draw-status hidden)) - (case (-> self look) - (('iron) - (sound-play "icrate-break") - ) - (('steel) - (sound-play "scrate-break") - ) - (('darkeco) - (sound-play "dcrate-break") - ) - (else - (sound-play "wcrate-break") - ) - ) - (case (-> self defense) - (('darkeco) - (let ((f0-0 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3)) - ) - (process-spawn - touch-tracker - :init touch-tracker-init - (-> self root trans) - (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) - 30 - :to self - ) - ) - ) - (case (-> self look) - (('darkeco) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 73) - -1 - #f - #f - #f - (-> self root trans) - :to *entity-pool* - ) - ) - (('steel 'iron) - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 72) - -1 - #f - #f - #f - (-> self root trans) - :to *entity-pool* - ) - ) - (else - (process-spawn - part-tracker - :init part-tracker-init - (-> *part-group-id-table* 71) - -1 - #f - #f - #f - (-> self root trans) - :to *entity-pool* - ) - ) - ) - ) - (case (-> self fact pickup-type) - (((pickup-type money) - (pickup-type buzzer) - (pickup-type eco-blue) - (pickup-type eco-yellow) - (pickup-type eco-red) - (pickup-type fuel-cell) - ) - (go-virtual special-contents-die) - ) - ) - (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (current-time))) - (until (time-elapsed? gp-1 (seconds 5)) - (suspend) - ) - ) - ) - ) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (case (-> self defense) + (('darkeco) + (cond + ((= (-> proc type) target) (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco))))) + (else + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 4) + (set! (-> a1-5 message) 'attack) + (set! (-> a1-5 param 0) (-> block param 0)) + (set! (-> a1-5 param 1) (the-as uint 'darkeco)) + (let ((v1-12 (+ *global-attack-id* 1))) (set! *global-attack-id* v1-12) (set! (-> a1-5 param 2) (the-as uint v1-12))) + (set! (-> a1-5 param 3) (the-as uint 0)) + (send-event-function proc a1-5))))))))) + :trans + (behavior () + (case (-> self type) + ((crate-buzzer) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0))))) + :code + (behavior ((arg0 symbol) (arg1 int)) + (clear-collide-with-as (-> self root)) + (if (nonzero? (-> self sound)) (stop! (-> self sound))) + (if (and *target* + (and (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut)) + (!= (-> self fact pickup-type) 6) + (not arg0))) + (logior! (-> self fact options) (fact-options instant-collect))) + (when (not arg0) + (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 0.04)) (suspend))) + (logior! (-> self draw status) (draw-status hidden)) + (case (-> self look) + (('iron) (sound-play "icrate-break")) + (('steel) (sound-play "scrate-break")) + (('darkeco) (sound-play "dcrate-break")) + (else (sound-play "wcrate-break"))) + (case (-> self defense) + (('darkeco) + (let ((f0-0 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3))) + (process-spawn touch-tracker + :init + touch-tracker-init + (-> self root trans) + (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) + 30 + :to + self))) + (case (-> self look) + (('darkeco) + (process-spawn part-tracker + :init + part-tracker-init + (-> *part-group-id-table* 73) + -1 + #f + #f + #f + (-> self root trans) + :to + *entity-pool*)) + (('steel 'iron) + (process-spawn part-tracker + :init + part-tracker-init + (-> *part-group-id-table* 72) + -1 + #f + #f + #f + (-> self root trans) + :to + *entity-pool*)) + (else + (process-spawn part-tracker + :init + part-tracker-init + (-> *part-group-id-table* 71) + -1 + #f + #f + #f + (-> self root trans) + :to + *entity-pool*)))) + (case (-> self fact pickup-type) + (((pickup-type money) (pickup-type buzzer) + (pickup-type eco-blue) + (pickup-type eco-yellow) + (pickup-type eco-red) + (pickup-type fuel-cell)) + (go-virtual special-contents-die))) + (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status complete) #t) + (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 5)) (suspend))))) (defstate special-contents-die (crate) :virtual #t - :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (case message - (('notify) - (case (-> block param 0) - (('pickup) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) - (+! (-> self child-count) -1) - (when (<= (-> self child-count) 0) - (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) - (process-entity-status! self (entity-perm-status bit-4) #f) - ) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status complete) #t) - (set! (-> gp-0 user-int8 0) 2) - (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) - (set! (-> self mask) v0-0) - v0-0 - ) - ) - ) - ) - ) - ) - ) - ) - :trans (-> (method-of-type crate die) trans) - :code (behavior () - (when (or (= (-> self fact pickup-type) (pickup-type money)) - (= (-> self defense) 'iron) - (= (-> self defense) 'steel) - ) - (let ((a0-4 (-> self entity))) - (if (when a0-4 - (let ((a0-5 (-> a0-4 extra perm task))) - (if a0-5 - (= a0-5 (game-task none)) - ) - ) - ) - (set! (-> self entity extra perm task) (game-task complete)) - ) - ) - ) - (clear-collide-with-as (-> self root)) - (logior! (-> self draw status) (draw-status hidden)) - (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0) - (set! (-> self child-count) (+ (process-count self) -1)) - (process-entity-status! self (entity-perm-status bit-4) #t) - (let ((v1-21 (-> self entity extra perm))) - (logior! (-> v1-21 status) (entity-perm-status user-set-from-cstage)) - (set! (-> v1-21 user-int8 0) 1) - ) - (when (-> self child) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - (while (-> self child) + :event + (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) + (set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1))) + (+! (-> self child-count) -1) + (when (<= (-> self child-count) 0) + (if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (process-entity-status! self (entity-perm-status bit-4) #f)) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status complete) #t) + (set! (-> gp-0 user-int8 0) 2) + (let ((v0-0 (logclear (-> self mask) (process-mask sleep)))) (set! (-> self mask) v0-0) v0-0)))))))) + :trans + (-> (method-of-type crate die) + trans) + :code + (behavior () + (when (or (= (-> self fact pickup-type) (pickup-type money)) (= (-> self defense) 'iron) (= (-> self defense) 'steel)) + (let ((a0-4 (-> self entity))) + (if (when a0-4 + (let ((a0-5 (-> a0-4 extra perm task))) (if a0-5 (= a0-5 (game-task none))))) + (set! (-> self entity extra perm task) (game-task complete))))) + (clear-collide-with-as (-> self root)) + (logior! (-> self draw status) (draw-status hidden)) + (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0) + (set! (-> self child-count) (+ (process-count self) -1)) + (process-entity-status! self (entity-perm-status bit-4) #t) + (let ((v1-21 (-> self entity extra perm))) + (logior! (-> v1-21 status) (entity-perm-status user-set-from-cstage)) + (set! (-> v1-21 user-int8 0) 1)) + (when (-> self child) + (logior! (-> self mask) (process-mask sleep)) (suspend) - ) - ) - ) - ) + (while (-> self child) + (suspend))))) (defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol)) (params-init self arg0) @@ -979,15 +742,13 @@ (set! (-> self defense) arg2) (art-init self) (check-dead self) - (none) - ) + (none)) (defmethod init-from-entity! ((this crate) (arg0 entity-actor)) (params-init this arg0) (art-init this) (check-dead this) - (none) - ) + (none)) (defmethod params-init ((this crate) (arg0 entity)) (stack-size-set! (-> this main-thread) 128) @@ -995,9 +756,7 @@ (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) - (set! (-> s4-0 no-reaction) - (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing) - ) + (set! (-> s4-0 no-reaction) (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)) (alloc-riders s4-0 1) (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-kind crate blue-eco-suck)) @@ -1006,315 +765,212 @@ (set! (-> s3-0 prim-core offense) (collide-offense touch)) (set! (-> s3-0 transform-index) 3) (set-vector! (-> s3-0 local-sphere) 0.0 3072.0 0.0 6963.2) - (set-root-prim! s4-0 s3-0) - ) + (set-root-prim! s4-0 s3-0)) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root) s4-0) - ) - (set! (-> this fact) - (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) - ) + (set! (-> this root) s4-0)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc))) (let ((v1-27 (-> this entity extra perm))) - (set! (-> this fact pickup-amount) - (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-27 user-int8 1)))) - ) - ) + (set! (-> this fact pickup-amount) (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-27 user-int8 1)))))) (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> this fact pickup-amount) 0.0) - ) + (set! (-> this fact pickup-amount) 0.0)) (when arg0 (process-drawable-from-entity! this (the-as entity-actor arg0)) - (logclear! (-> this mask) (process-mask actor-pause)) - ) - (let ((a0-18 ((method-of-type res-lump get-property-struct) - (-> this entity) - 'crate-type - 'interp - -1000000000.0 - 'wood - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) + (logclear! (-> this mask) (process-mask actor-pause))) + (let ((a0-18 ((method-of-type res-lump get-property-struct) (-> this entity) + 'crate-type + 'interp + -1000000000.0 + 'wood + (the-as (pointer res-tag) #f) + *res-static-buf*))) (set! (-> this look) (the-as symbol a0-18)) - (set! (-> this defense) (the-as symbol a0-18)) - ) + (set! (-> this defense) (the-as symbol a0-18))) (case (-> this fact pickup-type) (((pickup-type buzzer)) (set! (-> this type) crate-buzzer) (when (= (-> this look) 'wood) (set! (-> this look) 'iron) - (set! (-> this defense) 'iron) - ) - ) - (else - (when (= (-> this look) 'iron) - (set! (-> this look) 'wood) - (set! (-> this defense) 'wood) - ) - ) - ) - (none) - ) + (set! (-> this defense) 'iron))) + (else (when (= (-> this look) 'iron) (set! (-> this look) 'wood) (set! (-> this defense) 'wood)))) + (none)) (defmethod art-init ((this crate)) (case (-> this look) (('iron) (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) - (initialize-skeleton this *crate-iron-sg* '()) - ) + (initialize-skeleton this *crate-iron-sg* ())) (('steel) (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) - (initialize-skeleton this *crate-steel-sg* '()) - ) + (initialize-skeleton this *crate-steel-sg* ())) (('darkeco) (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) (set! (-> this fact pickup-type) (pickup-type none)) - (set! (-> this fact pickup-amount) 0.0) - ) - (initialize-skeleton this *crate-darkeco-sg* '()) + (set! (-> this fact pickup-amount) 0.0)) + (initialize-skeleton this *crate-darkeco-sg* ()) (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) - ) - (('barrel) - (initialize-skeleton this *crate-barrel-sg* '()) - ) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0)) + (('barrel) (initialize-skeleton this *crate-barrel-sg* ())) (('bucket) (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) (set! (-> this fact pickup-type) (pickup-type none)) - (set! (-> this fact pickup-amount) 0.0) - ) - (initialize-skeleton this *crate-bucket-sg* '()) - ) - (('none) - (initialize-skeleton this *crate-wood-sg* '()) - (logior! (-> this draw status) (draw-status hidden)) - ) - (else - (initialize-skeleton this *crate-wood-sg* '()) - ) - ) + (set! (-> this fact pickup-amount) 0.0)) + (initialize-skeleton this *crate-bucket-sg* ())) + ((none) (initialize-skeleton this *crate-wood-sg* ()) (logior! (-> this draw status) (draw-status hidden))) + (else (initialize-skeleton this *crate-wood-sg* ()))) (cond ((logtest? (fact-options indestructible) (-> this fact options)) - (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) - ) + (set! (-> this root root-prim prim-core offense) (collide-offense indestructible))) ((logtest? (-> this fact options) (fact-options strong-attack)) - (set! (-> this root root-prim prim-core offense) (collide-offense strong-attack)) - ) + (set! (-> this root root-prim prim-core offense) (collide-offense strong-attack))) ((logtest? (-> this fact options) (fact-options normal-attack)) - (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) - ) + (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack))) ((logtest? (-> this fact options) (fact-options touch)) - (set! (-> this root root-prim prim-core offense) (collide-offense touch)) - ) - ) + (set! (-> this root root-prim prim-core offense) (collide-offense touch)))) (set! (-> this base quad) (-> this root trans quad)) (crate-post) (nav-mesh-connect this (-> this root) (the-as nav-control #f)) - this - ) + this) (defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) - (if arg0 - (set! (-> this look) arg0) - ) - (if arg1 - (set! (-> this defense) arg1) - ) - (none) - ) + (if arg0 (set! (-> this look) arg0)) + (if arg1 (set! (-> this defense) arg1)) + (none)) (defmethod check-dead ((this crate)) - (if (>= (-> this entity extra perm user-int8 0) 1) - (go (method-of-object this die) #t 0) - ) + (if (>= (-> this entity extra perm user-int8 0) 1) (go (method-of-object this die) #t 0)) 0 (go (method-of-object this wait)) 0 - (none) - ) + (none)) (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) - ) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0)))) 0 - (none) - ) - -(deftype barrel (crate) - () - ) + (none)) +(deftype barrel (crate) ()) (defmethod params-init ((this barrel) (arg0 entity)) - (let ((t9-0 (method-of-type crate params-init))) - (t9-0 this arg0) - ) + (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) (set! (-> this look) 'barrel) - (none) - ) - -(deftype bucket (crate) - () - ) + (none)) +(deftype bucket (crate) ()) (defmethod params-init ((this bucket) (arg0 entity)) - (let ((t9-0 (method-of-type crate params-init))) - (t9-0 this arg0) - ) + (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) (set! (-> this look) 'bucket) - (none) - ) + (none)) (defpartgroup group-buzzer-crate :id 74 :duration (seconds 0.017) :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) - :parts ((sp-item 302)) - ) + :parts ((sp-item 302))) (defpart 302 - :init-specs ((:texture (new 'static 'texture-id :page #x2)) - (:num 1.0) - (:scale-x (meters 1) (meters 1)) - (:rot-z (degrees 0) (degrees 360)) - (:scale-y :copy scale-x) - (:r 128.0) - (:g 96.0 32.0) - (:b 64.0 32.0) - (:a 16.0 32.0) - (:vel-y (meters 0.02) (meters 0.01)) - (:scalevel-x (meters 0.0033333334)) - (:rotvel-z (degrees -0.2) (degrees 0.4)) - (:scalevel-y :copy scalevel-x) - (:fade-a -0.16) - (:accel-y (meters -0.00033333333)) - (:friction 0.95) - (:timer (seconds 1)) - (:flags (bit2 bit12 bit14)) - (:conerot-x (degrees 60) (degrees 30)) - (:conerot-y (degrees 0) (degrees 360)) - ) - ) - -(deftype crate-buzzer (crate) - () - ) + :init-specs + ((:texture (new 'static 'texture-id :page #x2)) (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (bit2 bit12 bit14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)))) +(deftype crate-buzzer (crate) ()) (defmethod art-init ((this crate-buzzer)) - (let ((t9-0 (method-of-type crate art-init))) - (t9-0 this) - ) + (let ((t9-0 (method-of-type crate art-init))) (t9-0 this)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> this root trans)) - ) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> this root trans))) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) - (the-as crate this) - ) + (the-as crate this)) (defstate wait (crate-buzzer) :virtual #t - :trans (behavior () - (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (time-elapsed? (-> self state-time) (seconds 1.5)) - (rand-vu-percent? 0.03) - ) - (spawn (-> self part) (-> self root trans)) - (activate! (-> self smush) 0.2 90 150 1.0 1.0) - (logclear! (-> self mask) (process-mask sleep-code)) - ) - (if (nonzero? (-> self sound)) - (update! (-> self sound)) - ) - (if (and *target* (>= (-> *target* fact buzzer) 6.0)) - (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) - ) - ) - :code (behavior () - (set-time! (-> self state-time)) - (suspend) - (update-transforms! (-> self root)) - (loop + :trans + (behavior () + (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (time-elapsed? (-> self state-time) (seconds 1.5)) + (rand-vu-percent? 0.03)) + (spawn (-> self part) (-> self root trans)) + (activate! (-> self smush) 0.2 90 150 1.0 1.0) + (logclear! (-> self mask) (process-mask sleep-code))) + (if (nonzero? (-> self sound)) (update! (-> self sound))) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0))) + :code + (behavior () (set-time! (-> self state-time)) - (ja-post) - (logior! (-> self mask) (process-mask sleep-code)) (suspend) - (let ((f30-0 57001.605)) - (sound-play "crate-jump") - (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) - (+! f30-0 (* -245760.0 (seconds-per-frame))) - (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) - (when (< (-> self root trans y) (-> self base y)) - (set! (-> self root trans y) (-> self base y)) - (set! f30-0 (* -0.5 f30-0)) - (if (< (fabs f30-0) 16384.0) - (set! f30-0 0.0) - ) - ) - (crate-post) - (ja-post) - (suspend) - ) - ) - (set! (-> self root trans y) (-> self base y)) - ) - ) - :post #f - ) + (update-transforms! (-> self root)) + (loop (set-time! (-> self state-time)) + (ja-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + (let ((f30-0 57001.605)) + (sound-play "crate-jump") + (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) + (+! f30-0 (* -245760.0 (seconds-per-frame))) + (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) + (when (< (-> self root trans y) (-> self base y)) + (set! (-> self root trans y) (-> self base y)) + (set! f30-0 (* -0.5 f30-0)) + (if (< (fabs f30-0) 16384.0) (set! f30-0 0.0))) + (crate-post) + (ja-post) + (suspend))) + (set! (-> self root trans y) (-> self base y)))) + :post #f) (defstate bounce-on (crate-buzzer) :virtual #t - :code (behavior () - (while (!= (-> self smush amp) 0.0) - (spawn (-> self part) (-> self root trans)) - (suspend) - ) - (go-virtual wait) - ) - ) + :code + (behavior () + (while (!= (-> self smush amp) 0.0) + (spawn (-> self part) (-> self root trans)) + (suspend)) + (go-virtual wait))) (deftype pickup-spawner (crate) - ((blocker entity-actor) - ) - ) - + ((blocker entity-actor))) (defmethod params-init ((this pickup-spawner) (arg0 entity)) - (let ((t9-0 (method-of-type crate params-init))) - (t9-0 this arg0) - ) - (set! (-> this look) 'none) + (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0)) + (set! (-> this look) none) (set! (-> this blocker) #f) (if (logtest? (-> this fact options) (fact-options vent-blocked)) - (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) - ) - (none) - ) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0))) + (none)) (defmethod check-dead ((this pickup-spawner)) (go (method-of-object this wait)) 0 - (none) - ) + (none)) (defstate wait (pickup-spawner) :virtual #t - :code (behavior () - (loop - (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) - (go-virtual die #t 0) - ) - (suspend) - ) - ) - ) + :code + (behavior () + (loop (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) + (go-virtual die #t 0)) + (suspend))))