mirror of
https://github.com/open-goal/jak-project
synced 2026-09-12 12:55:22 -04:00
cd68cb671e
Major change to how `deftype` shows up in our code: - the decompiler will no longer emit the `offset-assert`, `method-count-assert`, `size-assert` and `flag-assert` parameters. There are extremely few cases where having this in the decompiled code is helpful, as the types there come from `all-types` which already has those parameters. This also doesn't break type consistency because: - the asserts aren't compared. - the first step of the test uses `all-types`, which has the asserts, which will throw an error if they're bad. - the decompiler won't emit the `heap-base` parameter unless necessary now. - the decompiler will try its hardest to turn a fixed-offset field into an `overlay-at` field. It falls back to the old offset if all else fails. - `overlay-at` now supports field "dereferencing" to specify the offset that's within a field that's a structure, e.g.: ```lisp (deftype foobar (structure) ((vec vector :inline) (flags int32 :overlay-at (-> vec w)) ) ) ``` in this structure, the offset of `flags` will be 12 because that is the final offset of `vec`'s `w` field within this structure. - **removed ID from all method declarations.** IDs are only ever automatically assigned now. Fixes #3068. - added an `:overlay` parameter to method declarations, in order to declare a new method that goes on top of a previously-defined method. Syntax is `:overlay <method-name>`. Please do not ever use this. - added `state-methods` list parameter. This lets you quickly specify a list of states to be put in the method table. Same syntax as the `states` list parameter. The decompiler will try to put as many states in this as it can without messing with the method ID order. Also changes `defmethod` to make the first type definition (before the arguments) optional. The type can now be inferred from the first argument. Fixes #3093. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
1320 lines
44 KiB
Common Lisp
Vendored
Generated
1320 lines
44 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type maincavecam
|
|
(deftype maincavecam (pov-camera)
|
|
((seq uint64)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type maincavecam
|
|
(defmethod inspect ((this maincavecam))
|
|
(let ((t9-0 (method-of-type pov-camera inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tseq: ~D~%" (-> this seq))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *maincavecam-sg* maincavecam maincavecam-lod0-jg -1
|
|
((maincavecam-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 10)
|
|
)
|
|
|
|
;; definition for method 29 of type maincavecam
|
|
(defmethod set-stack-size! ((this maincavecam))
|
|
(stack-size-set! (-> this main-thread) 512)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate pov-camera-playing (maincavecam)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(cond
|
|
((zero? (-> self seq))
|
|
(let ((gp-1
|
|
(ppointer->handle
|
|
(process-spawn
|
|
fuel-cell
|
|
:init fuel-cell-init-as-clone
|
|
(process->handle self)
|
|
(-> self entity extra perm task)
|
|
:to (ppointer->process (-> self parent))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(ja-play-spooled-anim
|
|
(new 'static 'spool-anim :name "maincavecam-gnawer-fuel-cell" :index 3 :parts 1 :command-list '())
|
|
(the-as art-joint-anim #f)
|
|
(the-as art-joint-anim #f)
|
|
(the-as (function process-drawable symbol) false-func)
|
|
)
|
|
(let ((a0-7 (handle->process gp-1)))
|
|
(if a0-7
|
|
(send-event a0-7 'stop-cloning)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(suspend)
|
|
0
|
|
)
|
|
)
|
|
(go-virtual pov-camera-done-playing)
|
|
)
|
|
)
|
|
|
|
;; definition of type cave-water
|
|
(deftype cave-water (water-anim)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type cave-water
|
|
(defmethod inspect ((this cave-water))
|
|
(let ((t9-0 (method-of-type water-anim inspect)))
|
|
(t9-0 this)
|
|
)
|
|
this
|
|
)
|
|
|
|
;; definition for symbol ripple-for-cave-water, type ripple-wave-set
|
|
(define ripple-for-cave-water (new 'static 'ripple-wave-set
|
|
:count 3
|
|
:converted #f
|
|
:normal-scale 1.0
|
|
:wave (new 'static 'inline-array ripple-wave 4
|
|
(new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5)
|
|
(new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5)
|
|
(new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75)
|
|
(new 'static 'ripple-wave)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 22 of type cave-water
|
|
;; INFO: Return type mismatch rgbaf vs none.
|
|
(defmethod water-vol-method-22 ((this cave-water))
|
|
(let ((t9-0 (method-of-type water-anim water-vol-method-22)))
|
|
(t9-0 this)
|
|
)
|
|
(let ((v1-2 (new 'process 'ripple-control)))
|
|
(set! (-> this draw ripple) v1-2)
|
|
(set! (-> v1-2 global-scale) 3072.0)
|
|
(set! (-> v1-2 close-fade-dist) 163840.0)
|
|
(set! (-> v1-2 far-fade-dist) 245760.0)
|
|
(set! (-> v1-2 waveform) ripple-for-cave-water)
|
|
)
|
|
(case (-> this look)
|
|
((37 14)
|
|
(set-vector! (-> this draw color-mult) 0.2 0.1 0.3 0.75)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type cavecrusher
|
|
(deftype cavecrusher (process-drawable)
|
|
((root collide-shape :override)
|
|
)
|
|
(:states
|
|
cavecrusher-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cavecrusher
|
|
(defmethod inspect ((this cavecrusher))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *cavecrusher-sg* cavecrusher cavecrusher-lod0-jg -1
|
|
((cavecrusher-lod0-mg (meters 20)) (cavecrusher-lod1-mg (meters 40)) (cavecrusher-lod2-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 3)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate cavecrusher-idle (cavecrusher)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch 'attack)
|
|
(when (= (-> proc type) target)
|
|
(if ((method-of-type touching-shapes-entry prims-touching-action?)
|
|
(the-as touching-shapes-entry (-> block param 0))
|
|
(-> *target* control)
|
|
(collide-action solid)
|
|
(collide-action)
|
|
)
|
|
(target-attack-up *target* 'attack-or-shove 'deadlyup)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(ja-no-eval :group! cavecrusher-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(update! (-> self sound))
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; definition for method 11 of type cavecrusher
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this cavecrusher) (arg0 entity-actor))
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
|
(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 enemy))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-0 transform-index) 0)
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 11468.8)
|
|
(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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton this *cavecrusher-sg* '())
|
|
(set! (-> this sound)
|
|
(new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root trans))
|
|
)
|
|
(ja-channel-push! 1 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 4))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s5-1 frame-num) 0.0)
|
|
)
|
|
(ja-post)
|
|
(update-transforms! (-> this root))
|
|
(go cavecrusher-idle)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type cavetrapdoor
|
|
(deftype cavetrapdoor (process-drawable)
|
|
((root collide-shape-moving :override)
|
|
(delay-before-wiggle int32)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
trigger
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cavetrapdoor
|
|
(defmethod inspect ((this cavetrapdoor))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tdelay-before-wiggle: ~D~%" (-> this delay-before-wiggle))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *cavetrapdoor-sg* cavetrapdoor cavetrapdoor-lod0-jg -1
|
|
((cavetrapdoor-lod0-mg (meters 20)) (cavetrapdoor-lod1-mg (meters 40)) (cavetrapdoor-lod2-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:longest-edge (meters 5.7)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (cavetrapdoor)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch)
|
|
(when (= (-> proc type) target)
|
|
(when (>= (- (-> (target-pos 0) y) (-> self root trans y)) 409.6)
|
|
(send-event proc 'no-look-around (seconds 1.5))
|
|
(go-virtual trigger)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-no-eval :group! cavetrapdoor-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(transform-post)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(anim-loop)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate trigger (cavetrapdoor)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(when (nonzero? (-> self delay-before-wiggle))
|
|
(set-time! (-> self state-time))
|
|
(until (time-elapsed? (-> self state-time) (-> self delay-before-wiggle))
|
|
(suspend)
|
|
)
|
|
)
|
|
(ja-no-eval :group! cavetrapdoor-bob-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(clear-collide-with-as (-> self root))
|
|
(ja-no-eval :group! cavetrapdoor-swing-ja :num! (seek! (ja-aframe 290.0 0)) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! (ja-aframe 290.0 0)))
|
|
)
|
|
(restore-collide-with-as (-> self root))
|
|
(ja-no-eval :num! (seek!))
|
|
(while (not (ja-done? 0))
|
|
(suspend)
|
|
(ja-eval)
|
|
)
|
|
(until (or (or (not *target*) (< 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
|
|
(and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
|
(not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))
|
|
)
|
|
)
|
|
(not (logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-cam)))
|
|
)
|
|
)
|
|
(ja-no-eval :group! cavetrapdoor-idle-down-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(label cfg-14)
|
|
)
|
|
(ja-no-eval :group! cavetrapdoor-reset-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
|
|
(or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump))
|
|
(not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))
|
|
)
|
|
(logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-cam))
|
|
)
|
|
)
|
|
(while (not (ja-min? 0))
|
|
(suspend)
|
|
(ja :num! (seek! 0.0))
|
|
)
|
|
(goto cfg-14)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(go-virtual idle)
|
|
)
|
|
:post pusher-post
|
|
)
|
|
|
|
;; definition for method 11 of type cavetrapdoor
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this cavetrapdoor) (arg0 entity-actor))
|
|
(logior! (-> this mask) (process-mask platform))
|
|
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum 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)
|
|
)
|
|
(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 ground-object))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rider-plat-sticky))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-0 transform-index) 3)
|
|
(set-vector! (-> s3-0 local-sphere) 9830.4 10240.0 0.0 17203.2)
|
|
(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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton this *cavetrapdoor-sg* '())
|
|
(ja-channel-push! 1 0)
|
|
(let ((s4-1 (-> this skel root-channel 0)))
|
|
(joint-control-channel-group-eval!
|
|
s4-1
|
|
(the-as art-joint-anim (-> this draw art-group data 4))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s4-1 frame-num) 0.0)
|
|
)
|
|
(ja-post)
|
|
(update-transforms! (-> this root))
|
|
(let ((f0-7 (quaternion-y-angle (-> this root quat)))
|
|
(s4-2 (-> this draw bounds))
|
|
)
|
|
(set-vector! s4-2 0.0 -8192.0 4096.0 1.0)
|
|
(vector-rotate-around-y! s4-2 s4-2 f0-7)
|
|
(set! (-> s4-2 w) 25600.0)
|
|
)
|
|
(set! (-> this delay-before-wiggle) (the int (* 300.0 (res-lump-float arg0 'delay))))
|
|
(create-connection!
|
|
*cavecrystal-light-control*
|
|
this
|
|
(-> this entity)
|
|
(the-as (function object object object object object) cavecrystal-light-control-default-callback)
|
|
-1
|
|
8192.0
|
|
)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; definition of type caveflamepots
|
|
(deftype caveflamepots (process-drawable)
|
|
((root collide-shape :override)
|
|
(shove-up float)
|
|
(cycle-speed int32)
|
|
(cycle-pause int32)
|
|
(cycle-offset uint32)
|
|
(was-deadly? symbol)
|
|
(should-play-sound? symbol)
|
|
(launch-pos vector 2 :inline)
|
|
)
|
|
(:states
|
|
caveflamepots-active
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type caveflamepots
|
|
(defmethod inspect ((this caveflamepots))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tshove-up: ~f~%" (-> this shove-up))
|
|
(format #t "~T~Tcycle-speed: ~D~%" (-> this cycle-speed))
|
|
(format #t "~T~Tcycle-pause: ~D~%" (-> this cycle-pause))
|
|
(format #t "~T~Tcycle-offset: ~D~%" (-> this cycle-offset))
|
|
(format #t "~T~Twas-deadly?: ~A~%" (-> this was-deadly?))
|
|
(format #t "~T~Tshould-play-sound?: ~A~%" (-> this should-play-sound?))
|
|
(format #t "~T~Tlaunch-pos[2] @ #x~X~%" (-> this launch-pos))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 704
|
|
:init-specs ((:texture (new 'static 'texture-id :page #x2))
|
|
(:num 1.0)
|
|
(:scale-x (meters 2))
|
|
(:rot-z (degrees -180) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 128.0)
|
|
(:g 128.0)
|
|
(:b 0.0)
|
|
(:a 128.0)
|
|
(:vel-y (meters 0.04) (meters 0.01))
|
|
(:scalevel-x (meters -0.0039999997))
|
|
(:rotvel-z (degrees -1.8) (degrees 1.8))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-g -1.28)
|
|
(:fade-a -0.85333335)
|
|
(:accel-y (meters -0.0006))
|
|
(:timer (seconds 16.68))
|
|
(:flags (bit2 bit3))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 705
|
|
:init-specs ((:texture (new 'static 'texture-id :page #x2))
|
|
(:num 1.0)
|
|
(:scale-x (meters 2))
|
|
(:rot-z (degrees -180) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 128.0)
|
|
(:g 128.0)
|
|
(:b 0.0)
|
|
(:a 128.0)
|
|
(:vel-y (meters 0.04) (meters 0.01))
|
|
(:scalevel-x (meters -0.0039999997))
|
|
(:rotvel-z (degrees -1.8) (degrees 1.8))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-g -1.28)
|
|
(:fade-a -0.85333335)
|
|
(:accel-y (meters -0.0006))
|
|
(:timer (seconds 16.68))
|
|
(:flags (bit2 bit3))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveflamepots-active (caveflamepots)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch 'attack)
|
|
(when (= (-> proc type) target)
|
|
(when ((method-of-type touching-shapes-entry prims-touching-action?)
|
|
(the-as touching-shapes-entry (-> block param 0))
|
|
(-> *target* control)
|
|
(collide-action solid)
|
|
(collide-action)
|
|
)
|
|
(let ((s4-0 (new 'stack 'attack-info)))
|
|
(calc-shove-up (-> self root) s4-0 (-> self shove-up))
|
|
(if (or (= (-> *target* control unknown-surface00 mode) 'air)
|
|
(>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11))
|
|
(< 0.75 (-> *target* control poly-normal y))
|
|
)
|
|
(send-event
|
|
proc
|
|
'attack-or-shove
|
|
(-> block param 0)
|
|
(static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up))))
|
|
)
|
|
(send-event
|
|
proc
|
|
'attack-or-shove
|
|
(-> block param 0)
|
|
(static-attack-info ((mode 'burn)
|
|
(shove-up (meters 0))
|
|
(shove-back (meters 2))
|
|
(vector (-> *target* control poly-normal))
|
|
(angle 'shove)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let* ((v1-0 (-> self cycle-speed))
|
|
(a0-1 (- v1-0 (-> self cycle-pause)))
|
|
(gp-0 (mod (+ (current-time) (the-as time-frame (-> self cycle-offset))) v1-0))
|
|
)
|
|
(cond
|
|
((< gp-0 a0-1)
|
|
(when (sphere-in-view-frustum? (the-as sphere (-> self root root-prim prim-core)))
|
|
(launch-particles (-> *part-id-table* 704) (the-as vector (-> self launch-pos)))
|
|
(launch-particles (-> *part-id-table* 705) (the-as vector (&-> self stack 112)))
|
|
)
|
|
(when (-> self should-play-sound?)
|
|
(set! (-> self should-play-sound?) #f)
|
|
(sound-play "hot-flame")
|
|
)
|
|
(cond
|
|
((< gp-0 30)
|
|
(when (-> self was-deadly?)
|
|
(set! (-> self was-deadly?) #f)
|
|
(clear-collide-with-as (-> self root))
|
|
)
|
|
)
|
|
(else
|
|
(when (not (-> self was-deadly?))
|
|
(set! (-> self was-deadly?) #t)
|
|
(restore-collide-with-as (-> self root))
|
|
)
|
|
)
|
|
)
|
|
(when (and (not (-> self was-deadly?)) (< 60 gp-0))
|
|
(set! (-> self was-deadly?) #t)
|
|
(restore-collide-with-as (-> self root))
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self should-play-sound?) #t)
|
|
(when (-> self was-deadly?)
|
|
(set! (-> self was-deadly?) #f)
|
|
(clear-collide-with-as (-> self root))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(logior! (-> self mask) (process-mask sleep-code))
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type caveflamepots
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this caveflamepots) (arg0 entity-actor))
|
|
(local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag))
|
|
(set! (-> this was-deadly?) #f)
|
|
(set! (-> this should-play-sound?) #f)
|
|
(set! (-> this shove-up) (res-lump-float arg0 'shove :default 8192.0))
|
|
(logclear! (-> this mask) (process-mask enemy))
|
|
(logclear! (-> this mask) (process-mask attackable))
|
|
(logior! (-> this mask) (process-mask actor-pause))
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0)))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 12288.0 0.0 10240.0)
|
|
(set-root-prim! s4-0 s3-0)
|
|
(let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1))))
|
|
(set! (-> s2-0 prim-core collide-as) (collide-kind enemy))
|
|
(set! (-> s2-0 collide-with) (collide-kind target))
|
|
(set! (-> s2-0 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s2-0 local-sphere) 4915.2 8192.0 0.0 3686.4)
|
|
(append-prim s3-0 s2-0)
|
|
)
|
|
(let ((s2-1 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1))))
|
|
(set! (-> s2-1 prim-core collide-as) (collide-kind enemy))
|
|
(set! (-> s2-1 collide-with) (collide-kind target))
|
|
(set! (-> s2-1 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s2-1 local-sphere) 4915.2 14336.0 0.0 3276.8)
|
|
(append-prim s3-0 s2-1)
|
|
)
|
|
(let ((s2-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1))))
|
|
(set! (-> s2-2 prim-core collide-as) (collide-kind enemy))
|
|
(set! (-> s2-2 collide-with) (collide-kind target))
|
|
(set! (-> s2-2 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s2-2 local-sphere) -4915.2 8192.0 0.0 3686.4)
|
|
(append-prim s3-0 s2-2)
|
|
)
|
|
(let ((s2-3 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1))))
|
|
(set! (-> s2-3 prim-core collide-as) (collide-kind enemy))
|
|
(set! (-> s2-3 collide-with) (collide-kind target))
|
|
(set! (-> s2-3 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s2-3 local-sphere) -4915.2 14336.0 0.0 3276.8)
|
|
(append-prim s3-0 s2-3)
|
|
)
|
|
)
|
|
(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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(let ((v1-42 (new 'process 'path-control this 'path 0.0)))
|
|
(set! (-> this path) v1-42)
|
|
(logior! (-> v1-42 flags) (path-control-flag display draw-line draw-point draw-text))
|
|
(if (<= (-> v1-42 curve num-cverts) 0)
|
|
(go process-drawable-art-error "no path")
|
|
)
|
|
)
|
|
(let ((f0-23 (res-lump-float arg0 'rotoffset)))
|
|
(if (!= f0-23 0.0)
|
|
(quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-23)
|
|
)
|
|
)
|
|
(let ((f30-0 (quaternion-y-angle (-> this root quat))))
|
|
(let ((s4-1 (-> this launch-pos)))
|
|
(let ((v1-53 s4-1))
|
|
(set! (-> v1-53 0 x) 6144.0)
|
|
(set! (-> v1-53 0 y) 0.0)
|
|
(set! (-> v1-53 0 z) 0.0)
|
|
(set! (-> v1-53 0 w) 1.0)
|
|
)
|
|
(vector-rotate-around-y! (the-as vector s4-1) (the-as vector s4-1) f30-0)
|
|
(vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root trans))
|
|
)
|
|
(let ((s4-2 (the-as object (&-> this stack 112))))
|
|
(set-vector! (the-as vector s4-2) -6144.0 0.0 0.0 1.0)
|
|
(vector-rotate-around-y! (the-as vector s4-2) (the-as vector s4-2) f30-0)
|
|
(vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root trans))
|
|
)
|
|
(let ((s4-3 (-> this root root-prim)))
|
|
(dotimes (s3-1 (-> (the-as collide-shape-prim-group s4-3) num-prims))
|
|
(let ((a1-19 (-> (the-as collide-shape-prim-group s4-3) prims s3-1 local-sphere)))
|
|
(vector-rotate-around-y! a1-19 a1-19 f30-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(update-transforms! (-> this root))
|
|
(let ((f30-1 300.0))
|
|
(set! sv-16 (new 'static 'res-tag))
|
|
(let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16))))
|
|
(set! (-> this cycle-speed) (the int (* f30-1 (if (and v1-70 (> (the-as int (-> sv-16 elt-count)) 0))
|
|
(-> v1-70 0)
|
|
4.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((f30-2 (the float (-> this cycle-speed))))
|
|
(set! sv-32 (new 'static 'res-tag))
|
|
(let ((v1-74 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-32))))
|
|
(set! (-> this cycle-offset)
|
|
(the-as uint (the int (* f30-2 (if (and v1-74 (< 1 (the-as int (-> sv-32 elt-count))))
|
|
(-> v1-74 1)
|
|
0.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((f30-3 300.0))
|
|
(set! sv-48 (new 'static 'res-tag))
|
|
(let ((v1-77 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-48))))
|
|
(set! (-> this cycle-pause) (the int (* f30-3 (if (and v1-77 (< 2 (the-as int (-> sv-48 elt-count))))
|
|
(-> v1-77 2)
|
|
2.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(go caveflamepots-active)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type cavespatula
|
|
(deftype cavespatula (process-drawable)
|
|
((root collide-shape-moving :override)
|
|
(sync sync-info :inline)
|
|
)
|
|
(:states
|
|
cavespatula-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cavespatula
|
|
(defmethod inspect ((this cavespatula))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> this sync))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *cavespatula-sg* cavespatula 0 -1
|
|
((1 (meters 20)) (2 (meters 999999)))
|
|
:bounds (static-spherem 0 -1 0 18)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *cavespatula-darkcave-sg* cavespatula-darkcave cavespatula-darkcave-lod0-jg -1
|
|
((cavespatula-darkcave-lod0-mg (meters 20)) (cavespatula-darkcave-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -1 0 18)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate cavespatula-idle (cavespatula)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(update! (-> self sound))
|
|
(let ((f0-0 (get-current-phase (-> self sync))))
|
|
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0))
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(logior! (-> self mask) (process-mask sleep-code))
|
|
(suspend)
|
|
)
|
|
)
|
|
:post rider-post
|
|
)
|
|
|
|
;; definition for method 11 of type cavespatula
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this cavespatula) (arg0 entity-actor))
|
|
(logior! (-> this mask) (process-mask platform))
|
|
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum 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)
|
|
)
|
|
(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 ground-object))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rider-plat-sticky))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-0 transform-index) 0)
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 -8192.0 0.0 67584.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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(set! (-> this sound)
|
|
(new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans))
|
|
)
|
|
(case (-> (if (-> this entity)
|
|
(-> this entity extra level)
|
|
(-> *level* level-default)
|
|
)
|
|
name
|
|
)
|
|
(('darkcave)
|
|
(initialize-skeleton this *cavespatula-darkcave-sg* '())
|
|
(ja-channel-push! 1 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 3))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s5-1 frame-num) 0.0)
|
|
)
|
|
)
|
|
(else
|
|
(initialize-skeleton this *cavespatula-sg* '())
|
|
(ja-channel-push! 1 0)
|
|
(let ((s5-2 (-> this skel root-channel 0)))
|
|
(joint-control-channel-group-eval!
|
|
s5-2
|
|
(the-as art-joint-anim (-> this draw art-group data 3))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s5-2 frame-num) 0.0)
|
|
)
|
|
)
|
|
)
|
|
(logior! (-> this skel status) (janim-status inited))
|
|
(load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15)
|
|
(ja-post)
|
|
(update-transforms! (-> this root))
|
|
(create-connection!
|
|
*cavecrystal-light-control*
|
|
this
|
|
(-> this entity)
|
|
(the-as (function object object object object object) cavecrystal-light-control-default-callback)
|
|
-1
|
|
32768.0
|
|
)
|
|
(go cavespatula-idle)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type cavespatulatwo
|
|
(deftype cavespatulatwo (process-drawable)
|
|
((root collide-shape-moving :override)
|
|
(sync sync-info :inline)
|
|
)
|
|
(:states
|
|
cavespatulatwo-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cavespatulatwo
|
|
(defmethod inspect ((this cavespatulatwo))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> this sync))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *cavespatulatwo-sg* cavespatulatwo cavespatulatwo-lod0-jg -1
|
|
((cavespatulatwo-lod0-mg (meters 20)) (cavespatulatwo-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 0 2.5 0 21)
|
|
:longest-edge (meters 8.7)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate cavespatulatwo-idle (cavespatulatwo)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(update! (-> self sound))
|
|
(let ((f0-0 (get-current-phase (-> self sync))))
|
|
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0))
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(logior! (-> self mask) (process-mask sleep-code))
|
|
(suspend)
|
|
)
|
|
)
|
|
:post rider-post
|
|
)
|
|
|
|
;; definition for method 11 of type cavespatulatwo
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this cavespatulatwo) (arg0 entity-actor))
|
|
(logior! (-> this mask) (process-mask platform))
|
|
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum 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)
|
|
)
|
|
(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 ground-object))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rider-plat-sticky))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-0 transform-index) 0)
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 75776.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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton this *cavespatulatwo-sg* '())
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(logior! (-> this skel status) (janim-status inited))
|
|
(load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15)
|
|
(ja-channel-push! 1 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 3))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s5-1 frame-num) 0.0)
|
|
)
|
|
(transform-post)
|
|
(set! (-> this sound)
|
|
(new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans))
|
|
)
|
|
(go cavespatulatwo-idle)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type caveelevator
|
|
(deftype caveelevator (process-drawable)
|
|
((root collide-shape-moving :override)
|
|
(elev-mode uint64)
|
|
(elev-type int32)
|
|
(prev-frame-num float)
|
|
(last-update-bounce-time time-frame)
|
|
(orig-trans vector :inline)
|
|
(sync sync-info :inline)
|
|
(smush smush-control :inline)
|
|
(anim int32 2)
|
|
(wheel-ry-mat matrix :inline :offset 272)
|
|
)
|
|
(:methods
|
|
(caveelevator-method-20 (_type_) none)
|
|
(caveelevator-method-21 (_type_) float)
|
|
)
|
|
(:states
|
|
caveelevator-cycle-active
|
|
caveelevator-one-way-idle-end
|
|
caveelevator-one-way-idle-start
|
|
caveelevator-one-way-travel-to-end
|
|
caveelevator-one-way-travel-to-start
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type caveelevator
|
|
(defmethod inspect ((this caveelevator))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Telev-mode: ~D~%" (-> this elev-mode))
|
|
(format #t "~T~Telev-type: ~D~%" (-> this elev-type))
|
|
(format #t "~T~Tprev-frame-num: ~f~%" (-> this prev-frame-num))
|
|
(format #t "~T~Tlast-update-bounce-time: ~D~%" (-> this last-update-bounce-time))
|
|
(format #t "~T~Torig-trans: #<vector @ #x~X>~%" (-> this orig-trans))
|
|
(format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> this sync))
|
|
(format #t "~T~Tsmush: #<smush-control @ #x~X>~%" (-> this smush))
|
|
(format #t "~T~Tanim[2] @ #x~X~%" (-> this anim))
|
|
(format #t "~T~Twheel-ry-mat: #<matrix @ #x~X>~%" (-> this wheel-ry-mat))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *caveelevator-sg* caveelevator caveelevator-lod0-jg -1
|
|
((caveelevator-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4.25)
|
|
)
|
|
|
|
;; definition for function cavecrystal-light-control-caveelevator-callback
|
|
;; INFO: Used lq/sq
|
|
(defun cavecrystal-light-control-caveelevator-callback ((arg0 (pointer cavecrystal)) (arg1 int) (arg2 float))
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
(let ((v1-1 (-> arg0 0 node-list)))
|
|
(if (and (>= arg1 0) (nonzero? v1-1))
|
|
(vector<-cspace! s5-0 (-> v1-1 data arg1))
|
|
(set! (-> s5-0 quad) (-> arg0 0 root trans quad))
|
|
)
|
|
)
|
|
(set! (-> s5-0 w) arg2)
|
|
(let ((f0-1 (cavecrystal-light-control-method-10 *cavecrystal-light-control* s5-0))
|
|
(a2-2 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0))
|
|
(a1-5 (new 'static 'vector :x 0.3 :y 0.3 :z 0.3 :w 1.0))
|
|
)
|
|
(vector-lerp! (-> arg0 0 draw color-mult) a1-5 a2-2 f0-1)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 20 of type caveelevator
|
|
;; INFO: Used lq/sq
|
|
(defmethod caveelevator-method-20 ((this caveelevator))
|
|
(let ((v1-1 (current-time)))
|
|
(when (!= v1-1 (-> this last-update-bounce-time))
|
|
(set! (-> this last-update-bounce-time) v1-1)
|
|
(when (!= (-> this smush amp) 0.0)
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s5-0 quad) (-> this orig-trans quad))
|
|
(+! (-> s5-0 y) (* 819.2 (update! (-> this smush))))
|
|
(move-to-point! (-> this root) s5-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 21 of type caveelevator
|
|
(defmethod caveelevator-method-21 ((this caveelevator))
|
|
(let ((s5-0 (new 'stack-no-clear 'vector))
|
|
(gp-0 (-> this draw bounds))
|
|
)
|
|
(vector<-cspace! s5-0 (-> this node-list data 3))
|
|
(vector-! gp-0 s5-0 (-> this root trans))
|
|
(set! (-> gp-0 w) 17408.0)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveelevator-cycle-active (caveelevator)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('bonk)
|
|
(activate! (-> self smush) -1.0 60 150 1.0 1.0)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:exit (behavior ()
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(caveelevator-method-20 self)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(let ((f30-1 (* (get-current-phase (-> self sync)) (the float (ja-num-frames 0)))))
|
|
(if (< (-> self prev-frame-num) f30-1)
|
|
(ja :num! (seek! f30-1 10000.0))
|
|
(ja :num-func num-func-identity :frame-num f30-1)
|
|
)
|
|
(set! (-> self prev-frame-num) f30-1)
|
|
)
|
|
(suspend)
|
|
)
|
|
)
|
|
:post (behavior ()
|
|
(rider-post)
|
|
(caveelevator-method-21 self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveelevator-one-way-idle-start (caveelevator)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('bonk)
|
|
(activate! (-> self smush) -1.0 60 150 1.0 1.0)
|
|
(go caveelevator-one-way-travel-to-end)
|
|
)
|
|
(('attack 'touch)
|
|
(if (and (= (-> proc type) target) (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))))
|
|
(go caveelevator-one-way-travel-to-end)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(caveelevator-method-20 self)
|
|
)
|
|
:code (behavior ()
|
|
(ja :group! (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group))))
|
|
master-art-group-name
|
|
)
|
|
:num! min
|
|
)
|
|
(loop
|
|
(suspend)
|
|
)
|
|
)
|
|
:post (behavior ()
|
|
(rider-post)
|
|
(caveelevator-method-21 self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveelevator-one-way-travel-to-end (caveelevator)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('bonk)
|
|
(activate! (-> self smush) -1.0 60 150 1.0 1.0)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:exit (behavior ()
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(caveelevator-method-20 self)
|
|
)
|
|
:code (behavior ()
|
|
(ja :group! (-> self draw art-group data (-> self anim 0)) :num! min)
|
|
(ja-no-eval :num! (seek!))
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(go caveelevator-one-way-idle-end)
|
|
)
|
|
:post (behavior ()
|
|
(rider-post)
|
|
(caveelevator-method-21 self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveelevator-one-way-idle-end (caveelevator)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('bonk)
|
|
(activate! (-> self smush) -1.0 60 150 1.0 1.0)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
)
|
|
:trans (behavior ()
|
|
(cond
|
|
((zero? (-> self root riders num-riders))
|
|
(if (time-elapsed? (-> self state-time) (seconds 3))
|
|
(go caveelevator-one-way-travel-to-start)
|
|
)
|
|
)
|
|
(else
|
|
(set-time! (-> self state-time))
|
|
)
|
|
)
|
|
(rider-trans)
|
|
(caveelevator-method-20 self)
|
|
)
|
|
:code (behavior ()
|
|
(ja :group! (-> self draw art-group data (-> self anim 0)) :num! max)
|
|
(loop
|
|
(suspend)
|
|
)
|
|
)
|
|
:post (behavior ()
|
|
(rider-post)
|
|
(caveelevator-method-21 self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate caveelevator-one-way-travel-to-start (caveelevator)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('bonk)
|
|
(activate! (-> self smush) -1.0 60 150 1.0 1.0)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:exit (behavior ()
|
|
(logior! (-> self mask) (process-mask actor-pause))
|
|
)
|
|
:trans (behavior ()
|
|
(rider-trans)
|
|
(caveelevator-method-20 self)
|
|
)
|
|
:code (behavior ()
|
|
(ja :group! (-> self draw art-group data (-> self anim 1)) :num! min)
|
|
(ja-no-eval :num! (seek!))
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(go caveelevator-one-way-idle-start)
|
|
)
|
|
:post (behavior ()
|
|
(rider-post)
|
|
(caveelevator-method-21 self)
|
|
)
|
|
)
|
|
|
|
;; definition for function caveelevator-joint-callback
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defun caveelevator-joint-callback ((arg0 caveelevator))
|
|
(let* ((gp-0 arg0)
|
|
(f1-1 (- (-> arg0 node-list data 3 bone transform vector 3 y) (-> gp-0 orig-trans y)))
|
|
(f30-0 (* 5.0929585 (- f1-1 (* (the float (the int (/ f1-1 12867.963))) 12867.963))))
|
|
(s3-0 (-> arg0 node-list data 5 bone transform))
|
|
(s4-0 (-> arg0 node-list data 4 bone transform))
|
|
(s5-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> s5-0 quad) (-> s3-0 vector 3 quad))
|
|
(matrix-rotate-x! s3-0 f30-0)
|
|
(matrix*! s3-0 s3-0 (-> gp-0 wheel-ry-mat))
|
|
(set! (-> s3-0 vector 3 quad) (-> s5-0 quad))
|
|
(set! (-> s5-0 quad) (-> s4-0 vector 3 quad))
|
|
(matrix-rotate-x! s4-0 (- f30-0))
|
|
(matrix*! s4-0 s4-0 (-> gp-0 wheel-ry-mat))
|
|
(set! (-> s4-0 vector 3 quad) (-> s5-0 quad))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type caveelevator
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this caveelevator) (arg0 entity-actor))
|
|
(local-vars (v1-43 int) (sv-16 res-tag))
|
|
(set! (-> this prev-frame-num) 10000.0)
|
|
(set! (-> this last-update-bounce-time) 0)
|
|
(logior! (-> this mask) (process-mask platform))
|
|
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum 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)
|
|
)
|
|
(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 ground-object))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rider-plat-sticky rider-plat))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-0 transform-index) 3)
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 17408.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)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton this *caveelevator-sg* '())
|
|
(logior! (-> this skel status) (janim-status inited))
|
|
(set! (-> this skel postbind-function) caveelevator-joint-callback)
|
|
(set! sv-16 (new 'static 'res-tag))
|
|
(let ((v1-28 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16))))
|
|
(when v1-28
|
|
(+! (-> this root trans x) (-> v1-28 0))
|
|
(+! (-> this root trans y) (-> v1-28 1))
|
|
(+! (-> this root trans z) (-> v1-28 2))
|
|
)
|
|
)
|
|
(set! (-> this orig-trans quad) (-> this root trans quad))
|
|
(let ((f0-13 (res-lump-float (-> this entity) 'rotoffset)))
|
|
(if (!= f0-13 0.0)
|
|
(quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13)
|
|
)
|
|
)
|
|
(let ((f0-14 (quaternion-y-angle (-> this root quat))))
|
|
(matrix-rotate-y! (-> this wheel-ry-mat) f0-14)
|
|
)
|
|
(set-zero! (-> this smush))
|
|
(let ((s5-1 (res-lump-value arg0 'mode uint128)))
|
|
0
|
|
(set! (-> this elev-type) (the-as int s5-1))
|
|
(let ((v1-42 s5-1))
|
|
(cond
|
|
((zero? v1-42)
|
|
(set! v1-43 0)
|
|
(set! (-> this anim 0) 2)
|
|
)
|
|
((= (the-as uint v1-42) 1)
|
|
(set! v1-43 1)
|
|
(set! (-> this anim 0) 3)
|
|
(set! (-> this anim 1) 4)
|
|
)
|
|
((= (the-as uint v1-42) 2)
|
|
(set! v1-43 0)
|
|
(set! (-> this anim 0) 5)
|
|
)
|
|
(else
|
|
(set! v1-43 0)
|
|
(set! (-> this anim 0) 2)
|
|
(set! (-> this elev-type) (the-as int s5-1))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> this elev-mode) (the-as uint v1-43))
|
|
(ja-channel-set! 1)
|
|
(let ((s4-1 (-> this skel root-channel 0)))
|
|
(joint-control-channel-group-eval!
|
|
s4-1
|
|
(the-as art-joint-anim (-> this draw art-group data (-> this anim 0)))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s4-1 frame-num) 0.0)
|
|
)
|
|
(if (= (the-as uint s5-1) 1)
|
|
(create-connection!
|
|
*cavecrystal-light-control*
|
|
this
|
|
(-> this entity)
|
|
(the-as (function object object object object object) cavecrystal-light-control-caveelevator-callback)
|
|
3
|
|
8192.0
|
|
)
|
|
(create-connection!
|
|
*cavecrystal-light-control*
|
|
this
|
|
(-> this entity)
|
|
(the-as (function object object object object object) cavecrystal-light-control-default-callback)
|
|
3
|
|
8192.0
|
|
)
|
|
)
|
|
)
|
|
(transform-post)
|
|
(let ((v1-55 (-> this elev-mode)))
|
|
(cond
|
|
((zero? v1-55)
|
|
(load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15)
|
|
(go caveelevator-cycle-active)
|
|
)
|
|
((= v1-55 1)
|
|
(go caveelevator-one-way-idle-start)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|