mirror of
https://github.com/open-goal/jak-project
synced 2026-08-04 01:04:11 -04:00
1232 lines
51 KiB
Common Lisp
Vendored
Generated
1232 lines
51 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type vol-lava-plat
|
|
(deftype vol-lava-plat (rigid-body-platform)
|
|
((anchor-point vector :inline)
|
|
(path-u float)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type vol-lava-plat
|
|
(defmethod inspect ((this vol-lava-plat))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type rigid-body-platform inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tanchor-point: #<vector @ #x~X>~%" (-> this anchor-point))
|
|
(format #t "~2Tpath-u: ~f~%" (-> this path-u))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-vol-lava-plat vol-lava-plat vol-lava-plat-lod0-jg vol-lava-plat-idle-ja
|
|
((vol-lava-plat-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -4096 0 22528)
|
|
)
|
|
|
|
;; definition for symbol *vol-lava-plat-platform-constants*, type rigid-body-platform-constants
|
|
(define *vol-lava-plat-platform-constants* (new 'static 'rigid-body-platform-constants
|
|
:info (new 'static 'rigid-body-info
|
|
:mass 1.48
|
|
:inv-mass 0.6756757
|
|
:linear-damping 0.8
|
|
:angular-damping 1.0
|
|
:friction-factor 0.1
|
|
:cm-offset-joint (new 'static 'vector :w 1.0)
|
|
:inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 1) (meters 2))
|
|
)
|
|
:extra (new 'static 'rigid-body-object-extra-info
|
|
:max-time-step 0.02
|
|
:gravity (meters 80)
|
|
:idle-distance (meters 50)
|
|
:attack-force-scale 1.0
|
|
)
|
|
:name '*vol-lava-plat-platform-constants*
|
|
:drag-factor 2.0
|
|
:buoyancy-factor 1.5
|
|
:max-buoyancy-depth (meters 2)
|
|
:player-weight (meters 60)
|
|
:player-bonk-factor 0.3
|
|
:player-dive-factor 0.4
|
|
:player-force-distance (meters 1)
|
|
:player-force-clamp (meters 1000000)
|
|
:player-force-timeout (seconds 0.1)
|
|
:explosion-force (meters 1000)
|
|
:control-point-count 5
|
|
:platform #t
|
|
:sound-name #f
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active (vol-lava-plat)
|
|
:virtual #t
|
|
:event rigid-body-object-event-handler
|
|
:enter (behavior ()
|
|
(call-parent-state-handler enter)
|
|
(get-point-at-percent-along-path! (-> self path) (-> self rbody position) (-> self path-u) 'interp)
|
|
(ja-no-eval :group! vol-lava-plat-idle-ja :num! zero)
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
(set! (-> self info) *vol-lava-plat-platform-constants*)
|
|
(set! (-> self rbody info) (-> self info info))
|
|
)
|
|
:trans #f
|
|
:post (behavior ()
|
|
(+! (-> self path-u) (* 0.04 (seconds-per-frame)))
|
|
(if (>= (-> self path-u) 1.0)
|
|
(+! (-> self path-u) -1.0)
|
|
)
|
|
(get-point-at-percent-along-path! (-> self path) (-> self anchor-point) (-> self path-u) 'interp)
|
|
(+! (-> self anchor-point y) 2048.0)
|
|
(debug-draw (-> self path))
|
|
(rbody-post self)
|
|
)
|
|
)
|
|
|
|
;; definition for method 36 of type vol-lava-plat
|
|
(defmethod go-idle ((this vol-lava-plat))
|
|
(go (method-of-object this active))
|
|
)
|
|
|
|
;; definition for method 56 of type vol-lava-plat
|
|
(defmethod get-lava-height ((this vol-lava-plat) (arg0 vector))
|
|
(let ((f0-0 (path-control-method-23 (-> this path) arg0))
|
|
(gp-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(get-point-at-percent-along-path! (-> this path) gp-0 f0-0 'interp)
|
|
(+ 11059.2 (-> gp-0 y))
|
|
)
|
|
)
|
|
|
|
;; definition for method 31 of type vol-lava-plat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod apply-gravity! ((this vol-lava-plat) (arg0 float))
|
|
(call-parent-method this arg0)
|
|
(let ((a1-3 (new 'stack-no-clear 'vector)))
|
|
(vector-! a1-3 (-> this anchor-point) (-> this rbody position))
|
|
(set! (-> a1-3 y) 0.0)
|
|
(let* ((f0-1 (vector-length a1-3))
|
|
(f1-1 (* 500.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1)))))
|
|
)
|
|
(when (< 0.0 f1-1)
|
|
(vector-float*! a1-3 a1-3 (/ f1-1 f0-1))
|
|
(add-force! (-> this rbody) a1-3)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 34 of type vol-lava-plat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-collision! ((this vol-lava-plat))
|
|
(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) cshape-reaction-default)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-6 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-6 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-6 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-6 transform-index) 0)
|
|
(set-vector! (-> v1-6 local-sphere) 0.0 -4096.0 0.0 22528.0)
|
|
(set! (-> s5-0 total-prims) (the-as uint 1))
|
|
(set! (-> s5-0 root-prim) v1-6)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-9 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 35 of type vol-lava-plat
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defmethod init-rbody-control! ((this vol-lava-plat))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-vol-lava-plat" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> this path) (new
|
|
'process
|
|
'curve-control
|
|
this
|
|
(if (task-node-closed? (game-task-node volcano-darkeco-resolution))
|
|
'path
|
|
'pathshort
|
|
)
|
|
-1000000000.0
|
|
)
|
|
)
|
|
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
|
|
(alloc-rbody-control! this *vol-lava-plat-platform-constants*)
|
|
(set-vector! (-> this root scale) 1.4 1.3 1.4 1.0)
|
|
(let ((s5-2 (-> this info control-point-count)))
|
|
(dotimes (s4-2 s5-2)
|
|
(let ((s3-1 (-> this control-point-array data s4-2)))
|
|
(let ((f30-0 (* 65536.0 (/ (the float s4-2) (the float s5-2)))))
|
|
(set! (-> s3-1 local-pos x) (* 12288.0 (sin f30-0)))
|
|
(set! (-> s3-1 local-pos y) 4096.0)
|
|
(set! (-> s3-1 local-pos z) (* 12288.0 (cos f30-0)))
|
|
)
|
|
(set! (-> s3-1 local-pos w) 1.0)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function vol-lava-plat-init-by-other
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defbehavior vol-lava-plat-init-by-other vol-lava-plat ((arg0 entity-actor) (arg1 float))
|
|
(logior! (-> self mask) (process-mask platform))
|
|
(init-collision! self)
|
|
(process-drawable-from-entity! self arg0)
|
|
(init-rbody-control! self)
|
|
(set! (-> self path-u) arg1)
|
|
(go-idle self)
|
|
0
|
|
)
|
|
|
|
;; definition of type vol-lava-plat-spawner
|
|
(deftype vol-lava-plat-spawner (process)
|
|
((path path-control)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type vol-lava-plat-spawner
|
|
(defmethod inspect ((this vol-lava-plat-spawner))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tpath: ~A~%" (-> this path))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (vol-lava-plat-spawner)
|
|
:virtual #t
|
|
:code sleep-code
|
|
)
|
|
|
|
;; definition for method 7 of type vol-lava-plat-spawner
|
|
;; WARN: Return type mismatch process vs vol-lava-plat-spawner.
|
|
(defmethod relocate ((this vol-lava-plat-spawner) (offset int))
|
|
(if (nonzero? (-> this path))
|
|
(&+! (-> this path) offset)
|
|
)
|
|
(the-as vol-lava-plat-spawner ((method-of-type process relocate) this offset))
|
|
)
|
|
|
|
;; definition for method 11 of type vol-lava-plat-spawner
|
|
(defmethod init-from-entity! ((this vol-lava-plat-spawner) (arg0 entity-actor))
|
|
"Set up a newly created process from the entity that created it."
|
|
(set! (-> this path) (new
|
|
'process
|
|
'curve-control
|
|
this
|
|
(if (task-node-closed? (game-task-node volcano-darkeco-resolution))
|
|
'path
|
|
'pathshort
|
|
)
|
|
-1000000000.0
|
|
)
|
|
)
|
|
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
|
|
(let* ((f0-0 7500.0)
|
|
(f1-1 (the float (current-time)))
|
|
(f30-0 (/ (- f1-1 (* (the float (the int (/ f1-1 f0-0))) f0-0)) f0-0))
|
|
(f28-0 5.0)
|
|
(f26-0 (/ 1.0 f28-0))
|
|
)
|
|
(dotimes (s5-1 (the int f28-0))
|
|
(+! f30-0 f26-0)
|
|
(process-spawn
|
|
vol-lava-plat
|
|
(-> this entity)
|
|
(if (>= f30-0 1.0)
|
|
(+ -1.0 f30-0)
|
|
f30-0
|
|
)
|
|
:name "vol-lava-plat"
|
|
:to this
|
|
)
|
|
)
|
|
)
|
|
(go (method-of-object this idle))
|
|
)
|
|
|
|
;; definition of type vol-break-ground
|
|
(deftype vol-break-ground (process-drawable)
|
|
((root collide-shape :override)
|
|
(ridden symbol)
|
|
(ride-timer time-frame)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
active
|
|
collapse
|
|
)
|
|
(:methods
|
|
(set-proto-vis (_type_ symbol) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type vol-break-ground
|
|
(defmethod inspect ((this vol-break-ground))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tridden: ~A~%" (-> this ridden))
|
|
(format #t "~2Tride-timer: ~D~%" (-> this ride-timer))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-vol-break-ground vol-break-ground vol-break-ground-lod0-jg vol-break-ground-idle-ja
|
|
((vol-break-ground-lod0-mg (meters 20)) (vol-break-ground-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 10 12)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (vol-break-ground)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('trigger)
|
|
(go-virtual collapse)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set! (-> self draw force-lod) 1)
|
|
(ja-no-eval :group! vol-break-ground-idle-ja :num! zero)
|
|
(transform-post)
|
|
(set-proto-vis self #t)
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
)
|
|
:trans (behavior ()
|
|
(if (< (vector-vector-xz-distance (-> self root trans) (target-pos 0)) 81920.0)
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active (vol-break-ground)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('ridden 'edge-grabbed)
|
|
(let ((v0-0 #t))
|
|
(set! (-> self ridden) v0-0)
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(if (< 122880.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0)))
|
|
(go-virtual idle)
|
|
)
|
|
(set! (-> self ridden) #f)
|
|
(rider-trans)
|
|
(if (not (-> self ridden))
|
|
(set-time! (-> self ride-timer))
|
|
)
|
|
(if (time-elapsed? (-> self ride-timer) (seconds 0.1))
|
|
(go-virtual collapse)
|
|
)
|
|
0
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate collapse (vol-break-ground)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(set! (-> self draw force-lod) 0)
|
|
(set! (-> self draw bounds w) 491520.0)
|
|
(+! (-> self draw bounds y) -204800.0)
|
|
(set-proto-vis self #f)
|
|
(logclear! (-> self draw status) (draw-control-status no-draw))
|
|
(ja-post)
|
|
(set-time! (-> self state-time))
|
|
(sound-play "falling-cliff")
|
|
)
|
|
:trans (behavior ()
|
|
(if (time-elapsed? (-> self state-time) (seconds 0.2))
|
|
(logclear! (-> self root root-prim prim-core action) (collide-action rideable))
|
|
)
|
|
(rider-trans)
|
|
)
|
|
:code (behavior ()
|
|
(ja-no-eval :group! vol-break-ground-drop-ja :num! (seek! max 0.75) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(rider-post)
|
|
(suspend)
|
|
(ja :num! (seek! max 0.75))
|
|
)
|
|
(cleanup-for-death self)
|
|
)
|
|
:post (behavior ()
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg a))
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg d))
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg i))
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg l))
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg p))
|
|
(spawn-from-cspace (-> self part) (joint-node vol-break-ground-lod0-jg v))
|
|
)
|
|
)
|
|
|
|
;; definition for method 23 of type vol-break-ground
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod set-proto-vis ((this vol-break-ground) (arg0 symbol))
|
|
(let ((s5-0 *temp-string*)
|
|
(s3-0 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))
|
|
(s4-0 '(#f))
|
|
)
|
|
(when (nonzero? s3-0)
|
|
(clear s5-0)
|
|
(format s5-0 "vol-falling-bit-0~d.mb" s3-0)
|
|
(set! (-> s4-0 car) s5-0)
|
|
(prototypes-game-visible-set! s4-0 arg0 (level-get *level* 'volcanoa))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type vol-break-ground
|
|
(defmethod init-from-entity! ((this vol-break-ground) (arg0 entity-actor))
|
|
"Set up a newly created process from the entity that created it."
|
|
(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) cshape-reaction-default)
|
|
(set! (-> s4-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 26) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 27))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
|
|
(set! (-> s3-0 transform-index) 3)
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 57344.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-13 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-13 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-13 transform-index) 3)
|
|
(set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 12396.544)
|
|
)
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-15 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-15 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-15 transform-index) 4)
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 14662.042)
|
|
)
|
|
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
|
|
(set! (-> v1-17 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-17 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-17 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-17 transform-index) 5)
|
|
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 9102.541)
|
|
)
|
|
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0))))
|
|
(set! (-> v1-19 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-19 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-19 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-19 transform-index) 6)
|
|
(set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 22085.633)
|
|
)
|
|
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0))))
|
|
(set! (-> v1-21 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-21 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-21 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-21 transform-index) 7)
|
|
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 9147.597)
|
|
)
|
|
(let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0))))
|
|
(set! (-> v1-23 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-23 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-23 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-23 transform-index) 8)
|
|
(set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 11514.266)
|
|
)
|
|
(let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0))))
|
|
(set! (-> v1-25 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-25 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-25 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-25 transform-index) 9)
|
|
(set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 11179.622)
|
|
)
|
|
(let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0))))
|
|
(set! (-> v1-27 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-27 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-27 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-27 transform-index) 10)
|
|
(set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 9808.281)
|
|
)
|
|
(let ((v1-29 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 8) (the-as uint 0))))
|
|
(set! (-> v1-29 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-29 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-29 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-29 transform-index) 11)
|
|
(set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 8880.538)
|
|
)
|
|
(let ((v1-31 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 9) (the-as uint 0))))
|
|
(set! (-> v1-31 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-31 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-31 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-31 transform-index) 12)
|
|
(set-vector! (-> v1-31 local-sphere) 0.0 0.0 0.0 13326.745)
|
|
)
|
|
(let ((v1-33 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0))))
|
|
(set! (-> v1-33 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-33 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-33 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-33 transform-index) 13)
|
|
(set-vector! (-> v1-33 local-sphere) 0.0 0.0 0.0 10131.047)
|
|
)
|
|
(let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 11) (the-as uint 0))))
|
|
(set! (-> v1-35 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-35 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-35 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-35 transform-index) 14)
|
|
(set-vector! (-> v1-35 local-sphere) 0.0 0.0 0.0 15510.323)
|
|
)
|
|
(let ((v1-37 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0))))
|
|
(set! (-> v1-37 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-37 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-37 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-37 transform-index) 15)
|
|
(set-vector! (-> v1-37 local-sphere) 0.0 0.0 0.0 14842.675)
|
|
)
|
|
(let ((v1-39 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0))))
|
|
(set! (-> v1-39 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-39 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-39 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-39 transform-index) 16)
|
|
(set-vector! (-> v1-39 local-sphere) 0.0 0.0 0.0 21152.154)
|
|
)
|
|
(let ((v1-41 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0))))
|
|
(set! (-> v1-41 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-41 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-41 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-41 transform-index) 17)
|
|
(set-vector! (-> v1-41 local-sphere) 0.0 0.0 0.0 20766.31)
|
|
)
|
|
(let ((v1-43 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0))))
|
|
(set! (-> v1-43 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-43 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-43 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-43 transform-index) 18)
|
|
(set-vector! (-> v1-43 local-sphere) 0.0 0.0 0.0 19650.15)
|
|
)
|
|
(let ((v1-45 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0))))
|
|
(set! (-> v1-45 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-45 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-45 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-45 transform-index) 19)
|
|
(set-vector! (-> v1-45 local-sphere) 0.0 0.0 0.0 12206.489)
|
|
)
|
|
(let ((v1-47 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0))))
|
|
(set! (-> v1-47 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-47 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-47 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-47 transform-index) 20)
|
|
(set-vector! (-> v1-47 local-sphere) 0.0 0.0 0.0 14416.281)
|
|
)
|
|
(let ((v1-49 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 18) (the-as uint 0))))
|
|
(set! (-> v1-49 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-49 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-49 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-49 transform-index) 21)
|
|
(set-vector! (-> v1-49 local-sphere) 0.0 0.0 0.0 15859.303)
|
|
)
|
|
(let ((v1-51 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 19) (the-as uint 0))))
|
|
(set! (-> v1-51 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-51 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-51 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-51 transform-index) 22)
|
|
(set-vector! (-> v1-51 local-sphere) 0.0 0.0 0.0 16453.633)
|
|
)
|
|
(let ((v1-53 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 20) (the-as uint 0))))
|
|
(set! (-> v1-53 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-53 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-53 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-53 transform-index) 23)
|
|
(set-vector! (-> v1-53 local-sphere) 0.0 0.0 0.0 13432.013)
|
|
)
|
|
(let ((v1-55 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 21) (the-as uint 0))))
|
|
(set! (-> v1-55 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-55 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-55 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-55 transform-index) 24)
|
|
(set-vector! (-> v1-55 local-sphere) 0.0 0.0 0.0 17008.64)
|
|
)
|
|
(let ((v1-57 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 22) (the-as uint 0))))
|
|
(set! (-> v1-57 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-57 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-57 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-57 transform-index) 25)
|
|
(set-vector! (-> v1-57 local-sphere) 0.0 0.0 0.0 10731.52)
|
|
)
|
|
(let ((v1-59 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 23) (the-as uint 0))))
|
|
(set! (-> v1-59 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-59 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-59 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-59 transform-index) 26)
|
|
(set-vector! (-> v1-59 local-sphere) 0.0 0.0 0.0 17856.922)
|
|
)
|
|
(let ((v1-61 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 24) (the-as uint 0))))
|
|
(set! (-> v1-61 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-61 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-61 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-61 transform-index) 27)
|
|
(set-vector! (-> v1-61 local-sphere) 0.0 0.0 0.0 14433.484)
|
|
)
|
|
(let ((v1-63 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 25) (the-as uint 0))))
|
|
(set! (-> v1-63 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-63 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list))
|
|
(set! (-> v1-63 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-63 transform-index) 28)
|
|
(set-vector! (-> v1-63 local-sphere) 0.0 0.0 0.0 11855.053)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-66 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-66 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-66 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-vol-break-ground" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> this part) (create-launch-control group-vol-break-ground this))
|
|
(go (method-of-object this idle))
|
|
)
|
|
|
|
;; definition of type vol-stone-lid
|
|
(deftype vol-stone-lid (rigid-body-object)
|
|
((root collide-shape-moving :override)
|
|
(to-hole-vec vector :inline)
|
|
(hole entity-actor)
|
|
(hole-dist-xz float)
|
|
(hole-dist-y float)
|
|
(hole-sync-norm float)
|
|
(lava-timer time-frame)
|
|
(stop-timer time-frame)
|
|
)
|
|
(:state-methods
|
|
stopped
|
|
die-and-respawn
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type vol-stone-lid
|
|
(defmethod inspect ((this vol-stone-lid))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type rigid-body-object inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tto-hole-vec: #<vector @ #x~X>~%" (-> this to-hole-vec))
|
|
(format #t "~2Thole: ~A~%" (-> this hole))
|
|
(format #t "~2Thole-dist-xz: ~f~%" (-> this hole-dist-xz))
|
|
(format #t "~2Thole-dist-y: ~f~%" (-> this hole-dist-y))
|
|
(format #t "~2Thole-sync-norm: ~f~%" (-> this hole-sync-norm))
|
|
(format #t "~2Tlava-timer: ~D~%" (-> this lava-timer))
|
|
(format #t "~2Tstop-timer: ~D~%" (-> this stop-timer))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-vol-stone-lid vol-stone-lid vol-stone-lid-lod0-jg vol-stone-lid-idle-ja
|
|
((vol-stone-lid-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 3 0 5)
|
|
:shadow vol-stone-lid-shadow-mg
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
;; definition for symbol *vol-stone-lid-rigid-body-constants*, type rigid-body-object-constants
|
|
(define *vol-stone-lid-rigid-body-constants*
|
|
(new 'static 'rigid-body-object-constants
|
|
:info (new 'static 'rigid-body-info
|
|
:mass 4.0
|
|
:inv-mass 0.25
|
|
:linear-damping 0.98
|
|
:angular-damping 0.92
|
|
:bounce-factor 0.1
|
|
:friction-factor 0.1
|
|
:cm-offset-joint (new 'static 'vector :y 2048.0 :w 1.0)
|
|
:inertial-tensor-box (new 'static 'array meters 3 (meters 8) (meters 1) (meters 8))
|
|
)
|
|
:extra (new 'static 'rigid-body-object-extra-info
|
|
:max-time-step 0.033333335
|
|
:gravity (meters 80)
|
|
:idle-distance (meters 200)
|
|
:attack-force-scale 10.0
|
|
)
|
|
:name '*vol-stone-lid-rigid-body-constants*
|
|
)
|
|
)
|
|
|
|
;; definition for method 34 of type vol-stone-lid
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-collision! ((this vol-stone-lid))
|
|
(stack-size-set! (-> this main-thread) 32)
|
|
(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) cshape-reaction-default)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(set! (-> s5-0 penetrated-by) (penetrate))
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 10) 0)))
|
|
(set! (-> s5-0 total-prims) (the-as uint 11))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle obstacle-for-jak))
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list))
|
|
(set! (-> s4-0 prim-core action) (collide-action solid rideable no-standon))
|
|
(set! (-> s4-0 transform-index) 3)
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 20480.0)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-15 prim-core collide-with) (collide-spec obstacle hit-by-others-list))
|
|
(set! (-> v1-15 prim-core action) (collide-action solid))
|
|
(set! (-> v1-15 transform-index) 3)
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 3072.0 -1228.8 3072.0)
|
|
)
|
|
(let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-17 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-17 prim-core action) (collide-action solid))
|
|
(set! (-> v1-17 transform-index) 3)
|
|
(set-vector! (-> v1-17 local-sphere) 7168.0 3072.0 6144.0 3072.0)
|
|
)
|
|
(let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-19 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-19 prim-core action) (collide-action solid))
|
|
(set! (-> v1-19 transform-index) 3)
|
|
(set-vector! (-> v1-19 local-sphere) 819.2 3072.0 7372.8 3072.0)
|
|
)
|
|
(let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-21 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-21 prim-core action) (collide-action solid))
|
|
(set! (-> v1-21 transform-index) 3)
|
|
(set-vector! (-> v1-21 local-sphere) -4915.2 3072.0 6144.0 3072.0)
|
|
)
|
|
(let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-23 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-23 prim-core action) (collide-action solid))
|
|
(set! (-> v1-23 transform-index) 3)
|
|
(set-vector! (-> v1-23 local-sphere) -7168.0 3072.0 -1228.8 3072.0)
|
|
)
|
|
(let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-25 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-25 prim-core action) (collide-action solid))
|
|
(set! (-> v1-25 transform-index) 3)
|
|
(set-vector! (-> v1-25 local-sphere) -6553.6 3072.0 -9011.2 3072.0)
|
|
)
|
|
(let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-27 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-27 prim-core action) (collide-action solid))
|
|
(set! (-> v1-27 transform-index) 3)
|
|
(set-vector! (-> v1-27 local-sphere) 0.0 3072.0 -8192.0 3072.0)
|
|
)
|
|
(let ((v1-29 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-29 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-29 prim-core action) (collide-action solid))
|
|
(set! (-> v1-29 transform-index) 3)
|
|
(set-vector! (-> v1-29 local-sphere) 7168.0 3072.0 -8192.0 3072.0)
|
|
)
|
|
(let ((v1-31 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-31 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list))
|
|
(set! (-> v1-31 prim-core action) (collide-action solid))
|
|
(set! (-> v1-31 transform-index) 3)
|
|
(set-vector! (-> v1-31 local-sphere) 8192.0 3072.0 -1228.8 3072.0)
|
|
)
|
|
(let ((v1-33 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-33 prim-core collide-as) (collide-spec obstacle-for-jak))
|
|
(set! (-> v1-33 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-33 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-33 transform-index) 3)
|
|
(set-vector! (-> v1-33 local-sphere) 0.0 4096.0 0.0 20480.0)
|
|
)
|
|
(set! (-> s5-0 nav-radius) 10240.0)
|
|
(let ((v1-35 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-35 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-35 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (vol-stone-lid)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('trigger)
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(logclear! (-> self rbody flags) (rigid-body-flag active))
|
|
(logclear! (-> self rbody flags) (rigid-body-flag enable-physics))
|
|
(set-time! (-> self state-time))
|
|
)
|
|
:exit (behavior ()
|
|
(logior! (-> self rbody flags) (rigid-body-flag active))
|
|
(logior! (-> self rbody flags) (rigid-body-flag enable-physics))
|
|
)
|
|
:trans (behavior ()
|
|
(when (zero? (res-lump-value (-> self entity) 'extra-id uint128 :time -1000000000.0))
|
|
(if (and (time-elapsed? (-> self state-time) (seconds 1))
|
|
(and *target* (and (>= (-> self info extra idle-distance)
|
|
(vector-vector-distance (-> self root trans) (-> *target* control trans))
|
|
)
|
|
(not (logtest? (focus-status teleporting) (-> *target* focus-status)))
|
|
)
|
|
)
|
|
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-4 from) (process->ppointer self))
|
|
(set! (-> a1-4 num-params) 0)
|
|
(set! (-> a1-4 message) 'active?)
|
|
(let ((t9-2 send-event-function)
|
|
(v1-15 (-> self hole))
|
|
)
|
|
(t9-2
|
|
(if v1-15
|
|
(-> v1-15 extra process)
|
|
)
|
|
a1-4
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active (vol-stone-lid)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type rigid-body-object active) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set-time! (-> self lava-timer))
|
|
(set-time! (-> self stop-timer))
|
|
(rigid-body-object-method-42 self)
|
|
(apply-momentum! self)
|
|
)
|
|
:trans (behavior ()
|
|
(local-vars (a0-3 process))
|
|
(if (not (or (or (not *target*) (or (< (+ 4096.0 (-> self info extra idle-distance))
|
|
(vector-vector-distance (-> self root trans) (-> *target* control trans))
|
|
)
|
|
(focus-test? *target* teleporting)
|
|
)
|
|
)
|
|
(begin
|
|
(let ((v1-10 (-> self hole)))
|
|
(set! a0-3 (if v1-10
|
|
(-> v1-10 extra process)
|
|
)
|
|
)
|
|
)
|
|
(not a0-3)
|
|
)
|
|
(not (send-event a0-3 'active?))
|
|
)
|
|
)
|
|
(set-time! (-> self stop-timer))
|
|
)
|
|
(if (time-elapsed? (-> self stop-timer) (seconds 0.5))
|
|
(go-virtual idle)
|
|
)
|
|
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
|
|
(find-ground (-> self root) gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f))
|
|
(set! (-> self root ground-pat) (-> gp-0 best-other-tri pat))
|
|
)
|
|
(if (not (and (= (-> self root ground-pat material) (pat-material lava)) (!= (-> self root gspot-pos y) -40959590.0))
|
|
)
|
|
(set-time! (-> self lava-timer))
|
|
)
|
|
(if (time-elapsed? (-> self lava-timer) (seconds 2))
|
|
(go-virtual die-and-respawn)
|
|
)
|
|
(rider-trans)
|
|
)
|
|
:post (behavior ()
|
|
(let* ((v1-0 (-> self hole))
|
|
(gp-0 (if v1-0
|
|
(-> v1-0 extra process)
|
|
)
|
|
)
|
|
)
|
|
(when gp-0
|
|
(set! (-> self hole-dist-xz)
|
|
(vector-vector-xz-distance (-> (the-as process-drawable gp-0) root trans) (-> self root trans))
|
|
)
|
|
(set! (-> self hole-dist-y)
|
|
(fabs (- (-> self root trans y) (-> (the-as process-drawable gp-0) root trans y)))
|
|
)
|
|
(set! (-> self hole-sync-norm) (the-as float (send-event gp-0 'get-norm)))
|
|
(vector-! (-> self to-hole-vec) (-> (the-as process-drawable gp-0) root trans) (-> self root trans))
|
|
(if (< (-> self hole-dist-xz) 8192.0)
|
|
(send-event gp-0 'set-y (-> self root trans y))
|
|
(send-event gp-0 'set-y #f)
|
|
)
|
|
(send-event
|
|
gp-0
|
|
'in-hole
|
|
(vector-vector-xz-distance (-> (the-as process-drawable gp-0) root trans) (-> self root trans))
|
|
(- (-> self root trans y) (-> (the-as process-drawable gp-0) root trans y))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self player-force y) (/ (-> self player-force y) 10))
|
|
(if (and (logtest? (-> self rbody flags) (rigid-body-flag enable-physics))
|
|
(< (vector-length (-> self root transv)) 4096.0)
|
|
(< (* (vector-length (-> self rbody lin-momentum)) (-> self info info inv-mass)) 2457.6)
|
|
(< 12288.0 (-> self hole-dist-xz))
|
|
(< (-> self hole-dist-y) 8192.0)
|
|
)
|
|
(disable-physics! self)
|
|
)
|
|
(if (logtest? (-> self rbody flags) (rigid-body-flag enable-physics))
|
|
(rbody-post self)
|
|
(rigid-body-object-method-30 self)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate stopped (vol-stone-lid)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touched)
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate die-and-respawn (vol-stone-lid)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(process-spawn vol-stone-lid (-> self entity) :name "vol-stone-lid" :to *entity-pool*)
|
|
(cleanup-for-death self)
|
|
)
|
|
)
|
|
|
|
;; definition for method 31 of type vol-stone-lid
|
|
;; INFO: Used lq/sq
|
|
(defmethod apply-gravity! ((this vol-stone-lid) (arg0 float))
|
|
(when (< (-> this hole-dist-xz) 40960.0)
|
|
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s4-0 x) 0.0)
|
|
(set! (-> s4-0 y) (* (-> this rbody info mass)
|
|
(+ 81920.0 (-> *vol-stone-lid-rigid-body-constants* extra gravity))
|
|
(-> this hole-sync-norm)
|
|
(lerp-scale 0.0 1.0 (-> this hole-dist-xz) 40960.0 4096.0)
|
|
(lerp-scale 0.0 1.0 (-> this hole-dist-y) 163840.0 0.0)
|
|
)
|
|
)
|
|
(set! (-> s4-0 z) 0.0)
|
|
(set! (-> s4-0 w) 0.0)
|
|
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
|
(vector-copy! s3-0 (-> this rbody position))
|
|
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s2-0 x) 0.0)
|
|
(set! (-> s2-0 y) 8192.0)
|
|
(set! (-> s2-0 z) 0.0)
|
|
(set! (-> s2-0 w) 0.0)
|
|
(vector-orient-by-quat! s2-0 s2-0 (-> this root quat))
|
|
(vector+! s3-0 s3-0 s2-0)
|
|
)
|
|
(apply-impact! (-> this rbody) s3-0 s4-0)
|
|
)
|
|
)
|
|
0
|
|
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
|
(vector-copy! s4-1 (-> this to-hole-vec))
|
|
(let ((s3-1 (new 'stack-no-clear 'vector)))
|
|
(vector-copy! s3-1 (-> this rbody position))
|
|
(set! (-> s4-1 y) (/ (-> s4-1 y) -10))
|
|
(vector-float*! s4-1 s4-1 (lerp-scale 0.0 30.0 (-> this hole-dist-xz) 20480.0 4096.0))
|
|
(apply-impact! (-> this rbody) s3-1 s4-1)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
((method-of-type rigid-body-object apply-gravity!) this arg0)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 48 of type vol-stone-lid
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod on-impact ((this vol-stone-lid) (arg0 rigid-body-impact))
|
|
(if (< 20480.0 (-> arg0 impulse))
|
|
(sound-play-by-name
|
|
(static-sound-name "boulder-tumble")
|
|
(new-sound-id)
|
|
(the int (* 1024.0 (lerp-scale 0.0 1.0 (-> arg0 impulse) 20480.0 81920.0)))
|
|
0
|
|
0
|
|
(sound-group)
|
|
#t
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 47 of type vol-stone-lid
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod impulse-force<-penetrate ((this vol-stone-lid) (arg0 rigid-body-impact) (arg1 attack-info) (arg2 penetrate))
|
|
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
|
(cond
|
|
((logtest? arg2 (penetrate flop punch spin))
|
|
(set! (-> v1-0 y) 40960.0)
|
|
(set! (-> v1-0 x) 4.0)
|
|
(set! (-> arg0 impulse) (* (-> v1-0 y) (-> this info extra attack-force-scale)))
|
|
(apply-damage this (-> v1-0 x) arg0)
|
|
)
|
|
(else
|
|
((method-of-type rigid-body-object impulse-force<-penetrate) this arg0 arg1 arg2)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 49 of type vol-stone-lid
|
|
;; INFO: Used lq/sq
|
|
;; WARN: disable def twice: 7. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
|
(defmethod rbody-event-handler ((this vol-stone-lid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(with-pp
|
|
(case arg2
|
|
(('attack)
|
|
(let ((s5-0 (the-as object (-> arg3 param 1))))
|
|
(when (!= (-> (the-as attack-info s5-0) id) (-> this incoming-attack-id))
|
|
(impulse-handler this)
|
|
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
|
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
|
(let ((a0-8 (if (nonzero? (-> (the-as attack-info s5-0) attacker))
|
|
(as-type (handle->process (-> (the-as attack-info s5-0) attacker)) process-focusable)
|
|
*target*
|
|
)
|
|
)
|
|
)
|
|
(vector-copy! s3-0 (get-trans (the-as process-focusable a0-8) 0))
|
|
)
|
|
(vector-reset! s4-0)
|
|
(let ((s2-2 (-> this hole))
|
|
(a1-4 (new 'stack-no-clear 'event-message-block))
|
|
)
|
|
(set! (-> a1-4 from) (process->ppointer pp))
|
|
(set! (-> a1-4 num-params) 0)
|
|
(set! (-> a1-4 message) 'active?)
|
|
(let ((t9-3 send-event-function)
|
|
(v1-14 s2-2)
|
|
)
|
|
(when (t9-3
|
|
(if v1-14
|
|
(-> v1-14 extra process)
|
|
)
|
|
a1-4
|
|
)
|
|
(let ((s1-1 (new 'stack-no-clear 'inline-array 'vector 2)))
|
|
(vector-! (-> s1-1 0) (-> this root trans) (-> s2-2 extra trans))
|
|
(set! (-> s1-1 0 y) 0.0)
|
|
(vector-normalize! (-> s1-1 0) (if (= s2-2 (-> this hole))
|
|
6144.0
|
|
14336.0
|
|
)
|
|
)
|
|
(set! (-> s1-1 1 x)
|
|
(fmax 0.0 (fmin 1.0 (vector-segment-overlap
|
|
s3-0
|
|
(-> this root trans)
|
|
(vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> s1-1 0))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (= (-> s1-1 1 x) 1.0)
|
|
(vector+!
|
|
s4-0
|
|
s4-0
|
|
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s2-2 extra trans) (-> this root trans)) 1.0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(vector-normalize! s4-0 1.0)
|
|
(let ((a2-4 (vector-float*! (new 'stack-no-clear 'vector) s4-0 245760.0)))
|
|
(apply-impact! (-> this rbody) (-> this root trans) a2-4)
|
|
)
|
|
)
|
|
(rigid-body-control-method-12 (-> this rbody) 1.0)
|
|
(init-velocities! (-> this rbody))
|
|
(let ((v0-0 (the-as object (-> (the-as attack-info s5-0) id))))
|
|
(set! (-> this incoming-attack-id) (the-as uint v0-0))
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
((method-of-type rigid-body-object rbody-event-handler) this arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 42 of type vol-stone-lid
|
|
(defmethod rigid-body-object-method-42 ((this vol-stone-lid))
|
|
(logior! (-> this rbody flags) (rigid-body-flag enable-collision))
|
|
((method-of-type rigid-body-object rigid-body-object-method-42) this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 43 of type vol-stone-lid
|
|
(defmethod rigid-body-object-method-43 ((this vol-stone-lid))
|
|
(logclear! (-> this rbody flags) (rigid-body-flag enable-collision))
|
|
((method-of-type rigid-body-object rigid-body-object-method-43) this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 27 of type vol-stone-lid
|
|
(defmethod get-inv-mass ((this vol-stone-lid))
|
|
(/ 1.0 (lerp-scale 2.0 4.0 (-> this hole-dist-xz) 40960.0 8192.0))
|
|
)
|
|
|
|
;; definition for method 39 of type vol-stone-lid
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defmethod rbody-post ((this vol-stone-lid))
|
|
(let ((a1-0 (new 'stack-no-clear 'collide-query)))
|
|
(vector-copy! (-> a1-0 start-pos) (-> this rbody position))
|
|
(vector-float*! (-> a1-0 move-dist) (-> this rbody lin-velocity) (seconds-per-frame))
|
|
(let ((v1-3 a1-0))
|
|
(set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w)))
|
|
(set! (-> v1-3 collide-with) (-> this root root-prim prim-core collide-with))
|
|
(set! (-> v1-3 ignore-process0) this)
|
|
(set! (-> v1-3 ignore-process1) #f)
|
|
(set! (-> v1-3 ignore-pat) (-> this root pat-ignore-mask))
|
|
(set! (-> v1-3 action-mask) (collide-action solid))
|
|
)
|
|
(fill-using-line-sphere *collide-cache* a1-0)
|
|
)
|
|
(if *display-collide-cache*
|
|
(debug-draw *collide-cache*)
|
|
)
|
|
(let ((t9-2 (method-of-type rigid-body-object rbody-post)))
|
|
(t9-2 this)
|
|
)
|
|
(pull-riders! (-> this root))
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 35 of type vol-stone-lid
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-rbody-control! ((this vol-stone-lid))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-vol-stone-lid" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> this hole-dist-xz) 0.0)
|
|
(set! (-> this hole-dist-y) 0.0)
|
|
(set! (-> this hole-sync-norm) 0.0)
|
|
(vector-reset! (-> this to-hole-vec))
|
|
(let ((a0-3 (-> this skel root-channel 0)))
|
|
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 3)))
|
|
(set! (-> a0-3 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity)
|
|
)
|
|
(transform-post)
|
|
(alloc-rbody-control! this *vol-stone-lid-rigid-body-constants*)
|
|
(logior! (-> this skel status) (joint-control-status sync-math))
|
|
(set! (-> this draw shadow-ctrl)
|
|
(new 'process 'shadow-control -8192.0 8192.0 61440.0 (the-as vector #f) (shadow-flags shdf00) 245760.0)
|
|
)
|
|
(let ((v1-20 (-> this draw shadow-ctrl)))
|
|
(logclear! (-> v1-20 settings flags) (shadow-flags disable-draw))
|
|
)
|
|
0
|
|
(set! (-> this hole) (entity-actor-lookup (-> this entity) 'alt-actor 0))
|
|
(nav-mesh-connect-from-ent this)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function vol-stone-lid-init-by-other
|
|
;; WARN: Return type mismatch vol-stone-lid vs object.
|
|
(defbehavior vol-stone-lid-init-by-other vol-stone-lid ((arg0 entity-actor))
|
|
(set! (-> self level) (level-get *level* 'volcanoa))
|
|
(set! (-> self entity) arg0)
|
|
(init-collision! self)
|
|
(process-drawable-from-entity! self arg0)
|
|
(+! (-> self root trans y) 61440.0)
|
|
(init-rbody-control! self)
|
|
(go-idle self)
|
|
self
|
|
)
|