mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 15:28:58 -04:00
637990314b
Closes #736 --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
1831 lines
73 KiB
Common Lisp
Vendored
Generated
1831 lines
73 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for method 15 of type hud-plasmite
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod draw ((this hud-plasmite))
|
|
(set-hud-piece-position! (-> this sprites 0) (the int (+ 457.0 (* 130.0 (-> this offset)))) 210)
|
|
(format (clear (-> this strings 0 text)) "~D" (-> this values 0 current))
|
|
(set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (-> this sprites 0 pos) -16 20)
|
|
((method-of-type hud draw) this)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 16 of type hud-plasmite
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod update-values ((this hud-plasmite))
|
|
(set! (-> this values 0 target) (the int (-> *game-info* counter)))
|
|
((method-of-type hud update-values) this)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 17 of type hud-plasmite
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-callback ((this hud-plasmite))
|
|
(set! (-> this level) (level-get *level* 'strip))
|
|
(set! (-> this gui-id)
|
|
(add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0)
|
|
)
|
|
(logior! (-> this flags) (hud-flags show))
|
|
(set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb26)))
|
|
(set! (-> this sprites 0 flags) (the-as uint 4))
|
|
(set! (-> this sprites 0 scale-x) 1.0)
|
|
(set! (-> this sprites 0 scale-y) 1.0)
|
|
(alloc-string-if-needed this 0)
|
|
(set! (-> this strings 0 scale) 0.6)
|
|
(set! (-> this strings 0 flags) (font-flags kerning middle large))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition of type strip-hazard
|
|
(deftype strip-hazard (process-drawable)
|
|
((root collide-shape-moving :override)
|
|
(sync sync-linear :inline)
|
|
(shove-vec vector :inline)
|
|
(no-collision-timer uint64)
|
|
(attack-id uint32)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type strip-hazard
|
|
(defmethod inspect ((this strip-hazard))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tsync: #<sync-linear @ #x~X>~%" (-> this sync))
|
|
(format #t "~2Tshove-vec: #<vector @ #x~X>~%" (-> this shove-vec))
|
|
(format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer))
|
|
(format #t "~2Tattack-id: ~D~%" (-> this attack-id))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for function strip-handler
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defbehavior strip-handler strip-hazard ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(case arg2
|
|
(('touch 'attack)
|
|
(let ((gp-0 (as-type arg0 process-focusable)))
|
|
(when gp-0
|
|
(let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))))
|
|
(let* ((v1-4 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 root quat)))
|
|
(f0-1 (vector-dot s4-1 v1-4))
|
|
)
|
|
(if (< 0.0 f0-1)
|
|
(vector-float*! s4-1 s4-1 -1.0)
|
|
)
|
|
)
|
|
(when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id))
|
|
(vector s4-1)
|
|
(shove-back (-> self shove-vec z))
|
|
(shove-up (-> self shove-vec y))
|
|
(control (if (focus-test? gp-0 board)
|
|
1.0
|
|
0.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self no-collision-timer) (the-as uint (current-time)))
|
|
(let ((v1-18 (-> self root root-prim)))
|
|
(set! (-> v1-18 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-18 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function strip-trans
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defbehavior strip-trans strip-hazard ()
|
|
(when (and (nonzero? (-> self no-collision-timer))
|
|
(time-elapsed? (the-as int (-> self no-collision-timer)) (seconds 0.3))
|
|
)
|
|
(let ((v1-7 (-> self root root-prim)))
|
|
(set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as))
|
|
(set! (-> v1-7 prim-core collide-with) (-> self root backup-collide-with))
|
|
)
|
|
(set! (-> self no-collision-timer) (the-as uint 0))
|
|
0
|
|
)
|
|
(let ((a1-0 (new 'stack-no-clear 'overlaps-others-params)))
|
|
(set! (-> a1-0 options) (overlaps-others-options oo0))
|
|
(set! (-> a1-0 collide-with-filter) (the-as collide-spec -1))
|
|
(set! (-> a1-0 tlist) *touching-list*)
|
|
(find-overlapping-shapes (-> self root) a1-0)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (strip-hazard)
|
|
:virtual #t
|
|
:event strip-handler
|
|
:trans strip-trans
|
|
:code (behavior ()
|
|
(until #f
|
|
(let ((f0-1 (* (get-current-phase-no-mod (-> self sync)) (the float (+ (-> (ja-group) frames num-frames) -1))))
|
|
(a0-1 (-> self skel root-channel 0))
|
|
)
|
|
(let ((v1-14 (ja-group)))
|
|
(set! (-> a0-1 frame-group) v1-14)
|
|
)
|
|
(set! (-> a0-1 param 0) 1.0)
|
|
(set! (-> a0-1 frame-num) f0-1)
|
|
(joint-control-channel-group! a0-1 (ja-group) num-func-loop!)
|
|
)
|
|
(suspend)
|
|
)
|
|
#f
|
|
)
|
|
:post transform-post
|
|
)
|
|
|
|
;; definition for method 11 of type strip-hazard
|
|
;; INFO: Used lq/sq
|
|
(defmethod init-from-entity! ((this strip-hazard) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(set-vector! (-> this shove-vec) 0.0 12288.0 24576.0 1.0)
|
|
(set! (-> this no-collision-timer) (the-as uint 0))
|
|
(let* ((v1-1 *game-info*)
|
|
(a0-5 (+ (-> v1-1 attack-id) 1))
|
|
)
|
|
(set! (-> v1-1 attack-id) a0-5)
|
|
(set! (-> this attack-id) a0-5)
|
|
)
|
|
(let ((s4-0 (new 'stack-no-clear 'sync-info-params))
|
|
(s3-0 1200)
|
|
(f30-0 0.0)
|
|
)
|
|
(let* ((sv-64 (new 'static 'res-tag))
|
|
(v1-3 (res-lump-data arg0 'sync (pointer float) :tag-ptr (& sv-64)))
|
|
)
|
|
(when v1-3
|
|
(set! s3-0 (the int (* 300.0 (-> v1-3 0))))
|
|
(set! f30-0 (-> v1-3 1))
|
|
)
|
|
)
|
|
(let ((v1-4 0))
|
|
(if #t
|
|
(set! v1-4 (logior v1-4 1))
|
|
)
|
|
(set! (-> s4-0 sync-type) 'sync-linear)
|
|
(set! (-> s4-0 sync-flags) (the-as sync-flags v1-4))
|
|
)
|
|
(set! (-> s4-0 entity) arg0)
|
|
(set! (-> s4-0 period) (the-as uint s3-0))
|
|
(set! (-> s4-0 percent) 0.0)
|
|
(initialize! (-> this sync) s4-0)
|
|
(sync-now! (-> this sync) f30-0)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type fencespikes
|
|
(deftype fencespikes (strip-hazard)
|
|
((start-quat quaternion :inline)
|
|
(spin float)
|
|
(offset float)
|
|
(sparks-group uint32)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type fencespikes
|
|
(defmethod inspect ((this fencespikes))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type strip-hazard inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tstart-quat: #<quaternion @ #x~X>~%" (-> this start-quat))
|
|
(format #t "~2Tspin: ~f~%" (-> this spin))
|
|
(format #t "~2Toffset: ~f~%" (-> this offset))
|
|
(format #t "~2Tsparks-group: #x~X~%" (-> this sparks-group))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-fencespikes fencespikes fencespikes-lod0-jg fencespikes-idle-ja
|
|
((fencespikes-lod0-mg (meters 20)) (fencespikes-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 12 0 0 10.5)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (fencespikes)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(let ((gp-0 (ja-group))
|
|
(f0-0 (ja-aframe-num 0))
|
|
)
|
|
(cond
|
|
((and (= gp-0 fencespikes-idle-ja) (>= f0-0 47.0) (>= 67.0 f0-0))
|
|
(spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node fencespikes-lod0-jg head)))
|
|
)
|
|
((and (= gp-0 fencespikes-idle-ja) (>= f0-0 42.0) (>= 65.0 f0-0))
|
|
(seek! (-> self spin) 393216.0 32768.0)
|
|
)
|
|
((and (= gp-0 fencespikes-idle-ja) (>= f0-0 66.0) (>= 78.0 f0-0))
|
|
(seek! (-> self spin) 0.0 16384.0)
|
|
)
|
|
)
|
|
)
|
|
(quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* (-> self spin) (seconds-per-frame)))
|
|
(strip-trans)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type fencespikes
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this fencespikes) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(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) 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 2) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 3))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
|
|
(set-vector! (-> s3-0 local-sphere) 40960.0 0.0 0.0 45056.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(pusher-init s4-0)
|
|
(let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-14 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-14 transform-index) 10)
|
|
(set-vector! (-> v1-14 local-sphere) 36864.0 0.0 0.0 28672.0)
|
|
)
|
|
(let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-16 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-16 transform-index) 9)
|
|
(set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 8192.0)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-19 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-19 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-19 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-fencespikes" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(let ((t9-9 (method-of-type strip-hazard init-from-entity!)))
|
|
(t9-9 this arg0)
|
|
)
|
|
(quaternion-copy! (-> this start-quat) (-> this root quat))
|
|
(let* ((sv-16 "#f")
|
|
(a0-24 (entity-lookup-part-group arg0 (& sv-16) 'art-name))
|
|
)
|
|
(when a0-24
|
|
(let ((a0-25 (-> a0-24 0)))
|
|
(if (and (nonzero? a0-25) (= (-> a0-25 type) sparticle-launch-group))
|
|
(set! (-> this part) (create-launch-control a0-25 this))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; definition of type pitspikes
|
|
(deftype pitspikes (strip-hazard)
|
|
((spinner basic)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type pitspikes
|
|
(defmethod inspect ((this pitspikes))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type strip-hazard inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tspinner: ~A~%" (-> this spinner))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-pitspikes pitspikes pitspikes-lod0-jg pitspikes-idle-ja
|
|
((pitspikes-lod0-mg (meters 20)) (pitspikes-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 8 0 0 12)
|
|
)
|
|
|
|
;; definition for symbol *pitspikes-rotate-pos*, type vector
|
|
(define *pitspikes-rotate-pos* (new 'static 'vector))
|
|
|
|
;; definition for function pitspikes-birth-func
|
|
(defun pitspikes-birth-func ((arg0 sparticle-system)
|
|
(arg1 sparticle-cpuinfo)
|
|
(arg2 sprite-vec-data-3d)
|
|
(arg3 sparticle-launcher)
|
|
(arg4 sparticle-launch-state)
|
|
)
|
|
(let* ((gp-0 (-> arg2 x-y-z-sx))
|
|
(f30-0 (-> gp-0 w))
|
|
)
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
(vector-! s5-0 gp-0 *pitspikes-rotate-pos*)
|
|
(vector-rotate-y! s5-0 s5-0 (-> *pitspikes-rotate-pos* w))
|
|
(vector+! gp-0 *pitspikes-rotate-pos* s5-0)
|
|
)
|
|
(set! (-> gp-0 w) f30-0)
|
|
f30-0
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (pitspikes)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(update-trans!
|
|
(-> self sound)
|
|
(vector<-cspace! (new 'static 'vector) (joint-node pitspikes-lod0-jg rotatnode))
|
|
)
|
|
(update! (-> self sound))
|
|
)
|
|
:post (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) post)))
|
|
(if t9-0
|
|
((the-as (function none) t9-0))
|
|
)
|
|
)
|
|
(let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node pitspikes-lod0-jg main))))
|
|
(let ((f0-0 (quaternion-y-angle (-> self root quat))))
|
|
(set! (-> *pitspikes-rotate-pos* quad) (-> gp-0 quad))
|
|
(set! (-> *pitspikes-rotate-pos* w) f0-0)
|
|
)
|
|
(spawn (-> self part) gp-0)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 7 of type pitspikes
|
|
(defmethod relocate ((this pitspikes) (offset int))
|
|
(if (nonzero? (-> this spinner))
|
|
(&+! (-> this spinner) offset)
|
|
)
|
|
(call-parent-method this offset)
|
|
)
|
|
|
|
;; definition for method 11 of type pitspikes
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this pitspikes) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(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) cshape-reaction-default)
|
|
(set! (-> s4-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-6 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-6 transform-index) 4)
|
|
(set-vector! (-> v1-6 local-sphere) 33996.8 0.0 0.0 36864.0)
|
|
(set! (-> s4-0 total-prims) (the-as uint 1))
|
|
(set! (-> s4-0 root-prim) v1-6)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-9 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-9 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-pitspikes" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(let ((t9-6 (method-of-type strip-hazard init-from-entity!)))
|
|
(t9-6 this arg0)
|
|
)
|
|
(set! (-> this spinner) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :x 1.0 :w 1.0) 262144.0))
|
|
(set! (-> this sound) (new
|
|
'process
|
|
'ambient-sound
|
|
(static-sound-spec "pit-spikes" :fo-max 55)
|
|
(vector<-cspace! (new 'static 'vector) (-> this node-list data 4))
|
|
)
|
|
)
|
|
(set! (-> this part) (create-launch-control group-strip-pitspikes-dust this))
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; definition of type curtainsaw
|
|
(deftype curtainsaw (strip-hazard)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type curtainsaw
|
|
(defmethod inspect ((this curtainsaw))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type strip-hazard inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-curtainsaw curtainsaw curtainsaw-lod0-jg curtainsaw-idle-ja
|
|
((curtainsaw-lod0-mg (meters 20)) (curtainsaw-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 0 4 0 10.5)
|
|
:longest-edge (meters 0.0007044922)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (curtainsaw)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(update-trans! (-> self sound) (vector<-cspace! (new 'static 'vector) (joint-node curtainsaw-lod0-jg main)))
|
|
(update! (-> self sound))
|
|
)
|
|
:post (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) post)))
|
|
(if t9-0
|
|
((the-as (function none) t9-0))
|
|
)
|
|
)
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> gp-0 x) -4096.0)
|
|
(set! (-> gp-0 y) 0.0)
|
|
(set! (-> gp-0 z) 0.0)
|
|
(set! (-> gp-0 w) 1.0)
|
|
(let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node curtainsaw-lod0-jg main))))
|
|
(vector-orient-by-quat! gp-0 gp-0 (-> self root quat))
|
|
(vector+! s5-0 s5-0 gp-0)
|
|
(spawn (-> self part) s5-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type curtainsaw
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this curtainsaw) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(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) cshape-reaction-default)
|
|
(set! (-> s4-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-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 player-list))
|
|
(set! (-> v1-6 transform-index) 3)
|
|
(set-vector! (-> v1-6 local-sphere) 0.0 15155.2 0.0 15564.8)
|
|
(set! (-> s4-0 total-prims) (the-as uint 1))
|
|
(set! (-> s4-0 root-prim) v1-6)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-9 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-9 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-curtainsaw" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(let ((t9-6 (method-of-type strip-hazard init-from-entity!)))
|
|
(t9-6 this arg0)
|
|
)
|
|
(set! (-> this sound) (new
|
|
'process
|
|
'ambient-sound
|
|
(static-sound-spec "curtainsaw" :fo-max 55)
|
|
(vector<-cspace! (new 'static 'vector) (-> this node-list data 3))
|
|
)
|
|
)
|
|
(set! (-> this part) (create-launch-control group-strip-curtain-saw-dust this))
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; definition of type grenade-point
|
|
(deftype grenade-point (process-drawable)
|
|
((root collide-shape :override)
|
|
(camera-name string)
|
|
(parented? symbol)
|
|
(lightning-time time-frame)
|
|
(strike-table (array vector))
|
|
(last-strike-index int32)
|
|
(speed meters)
|
|
(part2 sparticle-launch-control)
|
|
(part3 sparticle-launch-control)
|
|
(part-lightning-hit sparticle-launch-control)
|
|
(enter-time time-frame)
|
|
(minimap connection-minimap)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
(die symbol)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type grenade-point
|
|
(defmethod inspect ((this grenade-point))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tcamera-name: ~A~%" (-> this camera-name))
|
|
(format #t "~2Tparented?: ~A~%" (-> this parented?))
|
|
(format #t "~2Tlightning-time: ~D~%" (-> this lightning-time))
|
|
(format #t "~2Tstrike-table: ~A~%" (-> this strike-table))
|
|
(format #t "~2Tlast-strike-index: ~D~%" (-> this last-strike-index))
|
|
(format #t "~2Tspeed: (meters ~m)~%" (-> this speed))
|
|
(format #t "~2Tpart2: ~A~%" (-> this part2))
|
|
(format #t "~2Tpart3: ~A~%" (-> this part3))
|
|
(format #t "~2Tpart-lightning-hit: ~A~%" (-> this part-lightning-hit))
|
|
(format #t "~2Tenter-time: ~D~%" (-> this enter-time))
|
|
(format #t "~2Tminimap: #<connection-minimap @ #x~X>~%" (-> this minimap))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 7 of type grenade-point
|
|
;; WARN: Return type mismatch process-drawable vs grenade-point.
|
|
(defmethod relocate ((this grenade-point) (offset int))
|
|
(if (nonzero? (-> this part2))
|
|
(&+! (-> this part2) offset)
|
|
)
|
|
(if (nonzero? (-> this part3))
|
|
(&+! (-> this part3) offset)
|
|
)
|
|
(if (nonzero? (-> this part-lightning-hit))
|
|
(&+! (-> this part-lightning-hit) offset)
|
|
)
|
|
(the-as grenade-point ((method-of-type process-drawable relocate) this offset))
|
|
)
|
|
|
|
;; definition for method 10 of type grenade-point
|
|
(defmethod deactivate ((this grenade-point))
|
|
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
|
(if (nonzero? (-> this part2))
|
|
(kill-and-free-particles (-> this part2))
|
|
)
|
|
(if (nonzero? (-> this part3))
|
|
(kill-and-free-particles (-> this part3))
|
|
)
|
|
(if (nonzero? (-> this part-lightning-hit))
|
|
(kill-and-free-particles (-> this part-lightning-hit))
|
|
)
|
|
((method-of-type process-drawable deactivate) this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for symbol *grenade-point-strike-table*, type (array (array vector))
|
|
(define *grenade-point-strike-table*
|
|
(the-as (array (array vector)) (new 'static 'boxed-array :type array
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 9851774.0 :y 355151.06 :z 669895.5 :w 1.0)
|
|
(new 'static 'vector :x 9872955.0 :y 353935.38 :z 574055.25 :w 1.0)
|
|
(new 'static 'vector :x 9892005.0 :y 352683.22 :z 541480.56 :w 1.0)
|
|
(new 'static 'vector :x 9890721.0 :y 354750.06 :z 587134.2 :w 1.0)
|
|
(new 'static 'vector :x 9880710.0 :y 354607.5 :z 576503.8 :w 1.0)
|
|
(new 'static 'vector :x 9890820.0 :y 352479.66 :z 540885.8 :w 1.0)
|
|
(new 'static 'vector :x 9852036.0 :y 355151.06 :z 668443.9 :w 1.0)
|
|
(new 'static 'vector :x 9960308.0 :y 304776.8 :z 613238.4 :w 1.0)
|
|
(new 'static 'vector :x 9852106.0 :y 355151.06 :z 668483.56 :w 1.0)
|
|
(new 'static 'vector :x 9855421.0 :y 368308.22 :z 637124.6 :w 1.0)
|
|
(new 'static 'vector :x 9869246.0 :y 352797.9 :z 571900.3 :w 1.0)
|
|
(new 'static 'vector :x 9940902.0 :y 321369.28 :z 670668.0 :w 1.0)
|
|
(new 'static 'vector :x 9957645.0 :y 336748.12 :z 560913.2 :w 1.0)
|
|
(new 'static 'vector :x 9858641.0 :y 353133.78 :z 550107.94 :w 1.0)
|
|
(new 'static 'vector :x 9852412.0 :y 355151.06 :z 670355.06 :w 1.0)
|
|
(new 'static 'vector :x 9891777.0 :y 354661.16 :z 588016.44 :w 1.0)
|
|
(new 'static 'vector :x 9881354.0 :y 354869.66 :z 582093.2 :w 1.0)
|
|
(new 'static 'vector :x 9861386.0 :y 400907.47 :z 637982.3 :w 1.0)
|
|
(new 'static 'vector :x 9954322.0 :y 305741.8 :z 638874.8 :w 1.0)
|
|
(new 'static 'vector :x 9879265.0 :y 354705.0 :z 581648.0 :w 1.0)
|
|
)
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 10137684.0 :y 391641.5 :z 918894.2 :w 1.0)
|
|
(new 'static 'vector :x 10218340.0 :y 338097.34 :z 834195.06 :w 1.0)
|
|
(new 'static 'vector :x 10136967.0 :y 353630.62 :z 908138.9 :w 1.0)
|
|
(new 'static 'vector :x 10221039.0 :y 337897.47 :z 828191.94 :w 1.0)
|
|
(new 'static 'vector :x 10236009.0 :y 405893.12 :z 985747.06 :w 1.0)
|
|
(new 'static 'vector :x 10149656.0 :y 365403.75 :z 917042.4 :w 1.0)
|
|
(new 'static 'vector :x 10187889.0 :y 371859.88 :z 866680.8 :w 1.0)
|
|
(new 'static 'vector :x 10138577.0 :y 337364.2 :z 836607.56 :w 1.0)
|
|
(new 'static 'vector :x 10223952.0 :y 337460.84 :z 884244.5 :w 1.0)
|
|
(new 'static 'vector :x 10223439.0 :y 337555.88 :z 882742.06 :w 1.0)
|
|
(new 'static 'vector :x 10152505.0 :y 338543.4 :z 843347.1 :w 1.0)
|
|
(new 'static 'vector :x 10150850.0 :y 386954.44 :z 920844.7 :w 1.0)
|
|
(new 'static 'vector :x 10204596.0 :y 351993.44 :z 874433.75 :w 1.0)
|
|
(new 'static 'vector :x 10151679.0 :y 338524.16 :z 844278.2 :w 1.0)
|
|
(new 'static 'vector :x 10185762.0 :y 394000.38 :z 935632.06 :w 1.0)
|
|
(new 'static 'vector :x 10135712.0 :y 337198.7 :z 840108.9 :w 1.0)
|
|
(new 'static 'vector :x 10208776.0 :y 338327.56 :z 823607.7 :w 1.0)
|
|
(new 'static 'vector :x 10232299.0 :y 390205.84 :z 913453.9 :w 1.0)
|
|
(new 'static 'vector :x 10234443.0 :y 336662.94 :z 884432.9 :w 1.0)
|
|
(new 'static 'vector :x 10104925.0 :y 393302.03 :z 907970.56 :w 1.0)
|
|
)
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 10343547.0 :y 286781.03 :z 386080.78 :w 1.0)
|
|
(new 'static 'vector :x 10522632.0 :y 363217.72 :z 314753.84 :w 1.0)
|
|
(new 'static 'vector :x 10489121.0 :y 322883.6 :z 277910.3 :w 1.0)
|
|
(new 'static 'vector :x 10387710.0 :y 286716.3 :z 369631.66 :w 1.0)
|
|
(new 'static 'vector :x 10379333.0 :y 290298.7 :z 432955.4 :w 1.0)
|
|
(new 'static 'vector :x 10340784.0 :y 286591.38 :z 365989.88 :w 1.0)
|
|
(new 'static 'vector :x 10511347.0 :y 307603.47 :z 401086.47 :w 1.0)
|
|
(new 'static 'vector :x 10507890.0 :y 321704.75 :z 367122.03 :w 1.0)
|
|
(new 'static 'vector :x 10387810.0 :y 286716.3 :z 370902.62 :w 1.0)
|
|
(new 'static 'vector :x 10504520.0 :y 369858.97 :z 445136.06 :w 1.0)
|
|
(new 'static 'vector :x 10341484.0 :y 286593.44 :z 371036.16 :w 1.0)
|
|
(new 'static 'vector :x 10511477.0 :y 323279.66 :z 434872.3 :w 1.0)
|
|
(new 'static 'vector :x 10400610.0 :y 287650.62 :z 405131.7 :w 1.0)
|
|
(new 'static 'vector :x 10353621.0 :y 287260.25 :z 317757.44 :w 1.0)
|
|
(new 'static 'vector :x 10417404.0 :y 287137.78 :z 243988.89 :w 1.0)
|
|
(new 'static 'vector :x 10439075.0 :y 366560.47 :z 362006.12 :w 1.0)
|
|
(new 'static 'vector :x 10396567.0 :y 286829.38 :z 383257.8 :w 1.0)
|
|
(new 'static 'vector :x 10358369.0 :y 287927.9 :z 273398.16 :w 1.0)
|
|
(new 'static 'vector :x 10519587.0 :y 357269.9 :z 374419.47 :w 1.0)
|
|
(new 'static 'vector :x 10458218.0 :y 288614.0 :z 266828.2 :w 1.0)
|
|
)
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 10822574.0 :y 440537.5 :z 270804.6 :w 1.0)
|
|
(new 'static 'vector :x 10815909.0 :y 414513.97 :z 351014.1 :w 1.0)
|
|
(new 'static 'vector :x 10813409.0 :y 430197.97 :z 373880.44 :w 1.0)
|
|
(new 'static 'vector :x 10748137.0 :y 446269.84 :z 411997.8 :w 1.0)
|
|
(new 'static 'vector :x 10767146.0 :y 395104.25 :z 328884.22 :w 1.0)
|
|
(new 'static 'vector :x 10831708.0 :y 435588.3 :z 340518.9 :w 1.0)
|
|
(new 'static 'vector :x 10754486.0 :y 394272.78 :z 318830.6 :w 1.0)
|
|
(new 'static 'vector :x 10810410.0 :y 450610.38 :z 375513.9 :w 1.0)
|
|
(new 'static 'vector :x 10745045.0 :y 445117.66 :z 411724.6 :w 1.0)
|
|
(new 'static 'vector :x 10715008.0 :y 441199.0 :z 409205.97 :w 1.0)
|
|
(new 'static 'vector :x 10776479.0 :y 436273.56 :z 368917.72 :w 1.0)
|
|
(new 'static 'vector :x 10713899.0 :y 393432.7 :z 361731.7 :w 1.0)
|
|
(new 'static 'vector :x 10747318.0 :y 444386.9 :z 411896.62 :w 1.0)
|
|
(new 'static 'vector :x 10796113.0 :y 393866.44 :z 330366.16 :w 1.0)
|
|
(new 'static 'vector :x 10703809.0 :y 394290.38 :z 376960.22 :w 1.0)
|
|
(new 'static 'vector :x 10704370.0 :y 396692.7 :z 388079.62 :w 1.0)
|
|
(new 'static 'vector :x 10695529.0 :y 399682.34 :z 392447.2 :w 1.0)
|
|
(new 'static 'vector :x 10746092.0 :y 409268.22 :z 409342.38 :w 1.0)
|
|
(new 'static 'vector :x 10699801.0 :y 400270.12 :z 400409.4 :w 1.0)
|
|
(new 'static 'vector :x 10744161.0 :y 409268.22 :z 407497.12 :w 1.0)
|
|
)
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 10508804.0 :y 354014.4 :z -12049.613 :w 1.0)
|
|
(new 'static 'vector :x 10429129.0 :y 354537.47 :z -518.9632 :w 1.0)
|
|
(new 'static 'vector :x 10518816.0 :y 381499.4 :z -20251.854 :w 1.0)
|
|
(new 'static 'vector :x 10473917.0 :y 351963.12 :z -55309.926 :w 1.0)
|
|
(new 'static 'vector :x 10524607.0 :y 397019.53 :z 54433.793 :w 1.0)
|
|
(new 'static 'vector :x 10412004.0 :y 357093.38 :z 15287.091 :w 1.0)
|
|
(new 'static 'vector :x 10523902.0 :y 397924.75 :z 104.448 :w 1.0)
|
|
(new 'static 'vector :x 10525589.0 :y 393901.66 :z 59083.57 :w 1.0)
|
|
(new 'static 'vector :x 10499603.0 :y 353315.22 :z -42083.53 :w 1.0)
|
|
(new 'static 'vector :x 10480145.0 :y 368308.22 :z -12931.481 :w 1.0)
|
|
(new 'static 'vector :x 10444827.0 :y 349193.4 :z -71675.086 :w 1.0)
|
|
(new 'static 'vector :x 10531369.0 :y 398163.16 :z -63935.28 :w 1.0)
|
|
(new 'static 'vector :x 10485295.0 :y 402773.6 :z 33989.426 :w 1.0)
|
|
(new 'static 'vector :x 10515049.0 :y 368451.6 :z -25089.229 :w 1.0)
|
|
(new 'static 'vector :x 10388387.0 :y 362443.16 :z 18808.014 :w 1.0)
|
|
(new 'static 'vector :x 10439744.0 :y 349721.8 :z -69525.09 :w 1.0)
|
|
(new 'static 'vector :x 10450132.0 :y 349748.84 :z -79091.71 :w 1.0)
|
|
(new 'static 'vector :x 10532251.0 :y 408451.9 :z -65625.7 :w 1.0)
|
|
(new 'static 'vector :x 10525454.0 :y 393798.88 :z 57976.832 :w 1.0)
|
|
(new 'static 'vector :x 10388897.0 :y 362443.16 :z 9165.21 :w 1.0)
|
|
)
|
|
(new 'static 'boxed-array :type vector
|
|
(new 'static 'vector :x 9545245.0 :y 350857.22 :z -702114.6 :w 1.0)
|
|
(new 'static 'vector :x 9638752.0 :y 350232.16 :z -584073.6 :w 1.0)
|
|
(new 'static 'vector :x 9620120.0 :y 374715.2 :z -722438.94 :w 1.0)
|
|
(new 'static 'vector :x 9572238.0 :y 347940.88 :z -635245.4 :w 1.0)
|
|
(new 'static 'vector :x 9614051.0 :y 369045.1 :z -724078.2 :w 1.0)
|
|
(new 'static 'vector :x 9640533.0 :y 374657.44 :z -718818.94 :w 1.0)
|
|
(new 'static 'vector :x 9580567.0 :y 383478.16 :z -720560.56 :w 1.0)
|
|
(new 'static 'vector :x 9562068.0 :y 347968.72 :z -661853.8 :w 1.0)
|
|
(new 'static 'vector :x 9511132.0 :y 353921.44 :z -721520.25 :w 1.0)
|
|
(new 'static 'vector :x 9582066.0 :y 348591.3 :z -601772.06 :w 1.0)
|
|
(new 'static 'vector :x 9561939.0 :y 347968.72 :z -668384.06 :w 1.0)
|
|
(new 'static 'vector :x 9610257.0 :y 396850.78 :z -717344.4 :w 1.0)
|
|
(new 'static 'vector :x 9665070.0 :y 369430.94 :z -685686.4 :w 1.0)
|
|
(new 'static 'vector :x 9664814.0 :y 383439.66 :z -705868.6 :w 1.0)
|
|
(new 'static 'vector :x 9524381.0 :y 349026.3 :z -631699.06 :w 1.0)
|
|
(new 'static 'vector :x 9650804.0 :y 362843.75 :z -670003.2 :w 1.0)
|
|
(new 'static 'vector :x 9511132.0 :y 353735.88 :z -721145.06 :w 1.0)
|
|
(new 'static 'vector :x 9563552.0 :y 347968.72 :z -667222.8 :w 1.0)
|
|
(new 'static 'vector :x 9512890.0 :y 353549.94 :z -722844.9 :w 1.0)
|
|
(new 'static 'vector :x 9543111.0 :y 348673.62 :z -665425.1 :w 1.0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set! (-> *lightning-spec-id-table* 16) (new 'static 'lightning-spec
|
|
:name "lightning-silo"
|
|
:flags (lightning-spec-flags lsf2)
|
|
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
|
|
:end-color (new 'static 'rgba :a #x80)
|
|
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
|
|
:fade-start-factor 0.2
|
|
:fade-time 120.0
|
|
:texture (new 'static 'texture-id :index #x83 :page #xc)
|
|
:reduction 0.42
|
|
:num-points 16
|
|
:box-size 45056.0
|
|
:merge-factor 0.5
|
|
:merge-count 4
|
|
:radius 3276.8
|
|
:duration 195.0
|
|
:duration-rand 24.0
|
|
:sound (static-sound-spec "silo-lightning")
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (grenade-point)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch 'attack)
|
|
(send-event proc 'ramp)
|
|
(when (logtest? (-> self level task-mask) (task-mask task1))
|
|
(cond
|
|
((send-event proc 'grenade (-> self speed))
|
|
(if (-> self camera-name)
|
|
(set-setting! 'entity-name (-> self camera-name) 0.0 -1)
|
|
)
|
|
)
|
|
((time-elapsed? (-> self enter-time) (seconds 3))
|
|
(talker-speech-class-method-12 (-> *talker-speech* 194) 1)
|
|
)
|
|
)
|
|
(set-time! (-> self enter-time))
|
|
)
|
|
#f
|
|
)
|
|
(('exit)
|
|
(remove-setting! 'entity-name)
|
|
)
|
|
(('die)
|
|
(go-virtual die #t)
|
|
)
|
|
(('kill)
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
(cleanup-for-death self)
|
|
(deactivate self)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set! (-> self lightning-time) (+ (current-time) -1))
|
|
)
|
|
:exit (behavior ()
|
|
(remove-setting! 'entity-name)
|
|
)
|
|
:code sleep-code
|
|
:post (behavior ()
|
|
(spawn (-> self part) (-> self root trans))
|
|
(when (< (-> self lightning-time) (current-time))
|
|
(set! (-> self lightning-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.6 1.4)))))
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s5-0 quad) (-> self root trans quad))
|
|
(let* ((gp-1 (-> self strike-table (-> self last-strike-index)))
|
|
(s4-1 (vector-! (new 'stack-no-clear 'vector) gp-1 s5-0))
|
|
(a1-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 13107.2))
|
|
(a0-7 (new 'stack-no-clear 'vector))
|
|
)
|
|
(vector+! s5-0 s5-0 a1-3)
|
|
(vector+! a0-7 s5-0 gp-1)
|
|
(vector-float*! a0-7 a0-7 0.5)
|
|
(set! (-> a0-7 w) (+ 16384.0 (* 0.5 (vector-length s4-1))))
|
|
(when (sphere-in-view-frustum? (the-as sphere a0-7))
|
|
(let ((s3-0 (process-spawn
|
|
lightning-tracker
|
|
:init lightning-tracker-init
|
|
(-> *lightning-spec-id-table* 16)
|
|
0
|
|
#f
|
|
self
|
|
s5-0
|
|
gp-1
|
|
:to self
|
|
)
|
|
)
|
|
(s4-3 (get-field-spec-by-id (-> *part-id-table* 1001) (sp-field-id spt-timer)))
|
|
(a1-11 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 gp-1) 1.0))
|
|
(s5-1 (new-stack-matrix0))
|
|
)
|
|
(if s4-3
|
|
(set! (-> s4-3 initial-valuef) (the-as float (+ (-> (the-as lightning-tracker (-> s3-0 0)) duration) -120)))
|
|
)
|
|
(forward-down->inv-matrix s5-1 a1-11 (vector-rotate-x! (new 'stack-no-clear 'vector) a1-11 16384.0))
|
|
(set! (-> s5-1 trans quad) (-> gp-1 quad))
|
|
(spawn-with-matrix (-> self part-lightning-hit) s5-1)
|
|
)
|
|
(set! (-> self last-strike-index) (mod (+ (-> self last-strike-index) (rand-vu-int-range 1 12)) 20))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(update! (-> self sound))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate die (grenade-point)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('kill)
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
(cleanup-for-death self)
|
|
(deactivate self)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ((arg0 symbol))
|
|
(play-communicator-speech! (-> *talker-speech* 194))
|
|
(process-entity-status! self (entity-perm-status subtask-complete) #t)
|
|
(kill-and-free-particles (-> self part))
|
|
(stop! (-> self sound))
|
|
(set! (-> self sound spec) (static-sound-spec "eco-plume2" :fo-min 5 :fo-max 90))
|
|
(while (not (task-complete? *game-info* (-> self entity extra perm task)))
|
|
(spawn (-> self part2) (-> self root trans))
|
|
(update! (-> self sound))
|
|
(suspend)
|
|
)
|
|
(kill-and-free-particles (-> self part2))
|
|
(until #f
|
|
(spawn (-> self part3) (-> self root trans))
|
|
(update! (-> self sound))
|
|
(suspend)
|
|
)
|
|
#f
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type grenade-point
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this grenade-point) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(set! (-> this parented?) #f)
|
|
(when (not (-> this parented?))
|
|
(let ((a1-1 (handle->process (-> *game-info* controller 0))))
|
|
(when a1-1
|
|
(change-parent this a1-1)
|
|
(set! (-> this parented?) #t)
|
|
)
|
|
)
|
|
)
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
|
(let ((v1-10 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
|
|
(set! (-> v1-10 prim-core collide-as) (collide-spec backgnd obstacle))
|
|
(set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 81920.0)
|
|
(set! (-> s4-0 total-prims) (the-as uint 1))
|
|
(set! (-> s4-0 root-prim) v1-10)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-13 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(set! (-> this camera-name) (res-lump-struct (-> this entity) 'camera-name string))
|
|
(set! (-> this part) (create-launch-control group-grenade-point this))
|
|
(set! (-> this part2) (create-launch-control group-grenade-point-hit this))
|
|
(set! (-> this part3) (create-launch-control group-grenade-point-dead this))
|
|
(set! (-> this part-lightning-hit) (create-launch-control group-lightning-silo-tip this))
|
|
(set! (-> this lightning-time) 0)
|
|
(set! (-> this strike-table)
|
|
(-> *grenade-point-strike-table*
|
|
(+ (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 1) :time -1000000000.0) -1)
|
|
)
|
|
)
|
|
(set! (-> this last-strike-index) (rand-vu-int-range 0 19))
|
|
(set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 118784.0))
|
|
(set! (-> this sound)
|
|
(new 'process 'ambient-sound (static-sound-spec "eco-plume1" :fo-min 5 :fo-max 90) (-> this root trans))
|
|
)
|
|
(update-transforms (-> this root))
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
|
|
(task-complete? *game-info* (game-task strip-grenade))
|
|
)
|
|
(go (method-of-object this die) #f)
|
|
(go (method-of-object this idle))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type grenade
|
|
(deftype grenade (projectile)
|
|
((tumble-quat quaternion :inline)
|
|
(blast-radius float)
|
|
(end-target handle)
|
|
)
|
|
(:methods
|
|
(grenade-method-40 (_type_) none)
|
|
(grenade-method-41 (_type_) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type grenade
|
|
(defmethod inspect ((this grenade))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type projectile inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Ttumble-quat: #<quaternion @ #x~X>~%" (-> this tumble-quat))
|
|
(format #t "~2Tblast-radius: ~f~%" (-> this blast-radius))
|
|
(format #t "~2Tend-target: ~D~%" (-> this end-target))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-grenade plasmitebomb plasmitebomb-lod0-jg plasmitebomb-idle-ja
|
|
((plasmitebomb-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 0.3)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-grenade-armed
|
|
:id 235
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 2)
|
|
:parts ((sp-item 1118 :flags (bit6)))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1118
|
|
:init-specs ((:texture (glow-soft effects))
|
|
(:num 1.0)
|
|
(:y (meters 0.07))
|
|
(:scale-x (meters 1))
|
|
(:rot-x (degrees 2.25))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 64.0 64.0)
|
|
(:b 128.0 128.0)
|
|
(:a 32.0 12.0)
|
|
(:scalevel-x (meters -0.0033333334))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-a -0.32)
|
|
(:timer (seconds 0.5))
|
|
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow))
|
|
(:userdata 2048.0)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-grenade-hit
|
|
:id 236
|
|
:duration (seconds 2)
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 6)
|
|
:parts ((sp-item 1119 :period (seconds 2) :length (seconds 0.017))
|
|
(sp-item 1120 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135))
|
|
(sp-item 1121 :period (seconds 2) :length (seconds 0.067))
|
|
(sp-item 1122 :fade-after (meters 120) :falloff-to (meters 120) :period (seconds 2) :length (seconds 0.067))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1120
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 6.0)
|
|
(:scale-x (meters 0.2) (meters 0.4))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 0.0 64.0)
|
|
(:b 192.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 (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14))
|
|
(:next-time (seconds 0.1) (seconds 0.097))
|
|
(:next-launcher 1123)
|
|
(:conerot-x (degrees 0) (degrees 180))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
(:conerot-radius (meters 2) (meters 4))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1123
|
|
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -1.4222223))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1122
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 3.0)
|
|
(:scale-x (meters 0.2))
|
|
(:rot-z (degrees 0) (degrees 180))
|
|
(:scale-y (meters 8))
|
|
(:r 196.0)
|
|
(:g 0.0)
|
|
(:b 255.0)
|
|
(:a 32.0 64.0)
|
|
(:scalevel-y (meters 0.42666668))
|
|
(:fade-a -1.6)
|
|
(:timer (seconds 0.2))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1119
|
|
:init-specs ((:texture (starflash effects))
|
|
(:num 1.0)
|
|
(:scale-x (meters 16))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 32.0)
|
|
(:g 0.0)
|
|
(:b 255.0)
|
|
(:a 96.0)
|
|
(:fade-a -1.7454545)
|
|
(:timer (seconds 0.18))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1121
|
|
:init-specs ((:texture (bigpuff effects))
|
|
(:num 4.0)
|
|
(:scale-x (meters 2.5) (meters 1.5))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 128.0)
|
|
(:g 32.0)
|
|
(:b 96.0 64.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 -1.6)
|
|
(:accel-y (meters 0.00016666666) (meters 0.00016666666))
|
|
(:friction 0.8)
|
|
(:timer (seconds 1.7))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14))
|
|
(:next-time (seconds 0.14))
|
|
(:next-launcher 1124)
|
|
(:conerot-x (degrees 0) (degrees 180))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1124
|
|
:init-specs ((:fade-r -0.53333336) (:fade-g -1.0666667) (:fade-b -0.53333336) (:fade-a -0.53333336))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-grenade-fired
|
|
:id 237
|
|
:duration (seconds 0.017)
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 8)
|
|
:parts ((sp-item 1125))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 1125
|
|
:init-specs ((:texture (bigpuff effects))
|
|
(:num 6.0)
|
|
(:scale-x (meters 0.6) (meters 0.4))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 16.0 4.0)
|
|
(:g 8.0 4.0)
|
|
(:b 16.0 4.0)
|
|
(:a 32.0 32.0)
|
|
(:vel-y (meters 0.01) (meters 0.0026666666))
|
|
(:scalevel-x (meters 0.0016666667))
|
|
(:rotvel-z (degrees -0.2) (degrees 0.4))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-r -0.35555556)
|
|
(:fade-g -0.35555556)
|
|
(:fade-b -0.35555556)
|
|
(:fade-a -0.30476192)
|
|
(:accel-y (meters -0.00033333333))
|
|
(:timer (seconds 0.4))
|
|
(:flags (sp-cpuinfo-flag-2))
|
|
(:next-time (seconds 0.2))
|
|
(:next-launcher 1126)
|
|
(:conerot-x (degrees 60) (degrees 30))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
(:rotate-y (degrees 0) (degrees 180))
|
|
)
|
|
)
|
|
|
|
;; definition for method 24 of type grenade
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod draw-laser-sight ((this grenade))
|
|
"TODO - confirm If applicable, draw the laser sight particles"
|
|
(part-tracker-spawn :to *entity-pool* :group group-grenade-fired :mat-joint (-> this root trans))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 25 of type grenade
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod spawn-impact-particles ((this grenade))
|
|
"Spawns associated particles with the projectile if applicable"
|
|
((method-of-type projectile spawn-impact-particles) this)
|
|
(ja-post)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 26 of type grenade
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod spawn-shell-particles ((this grenade))
|
|
"TODO - confirm"
|
|
(part-tracker-spawn :to *entity-pool* :group group-grenade-hit :mat-joint (-> this root trans))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 28 of type grenade
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod play-impact-sound ((this grenade) (arg0 projectile-options))
|
|
(let ((v1-0 arg0))
|
|
(cond
|
|
((zero? v1-0)
|
|
(sound-play "grenade-fire")
|
|
)
|
|
((= v1-0 (projectile-options lose-altitude))
|
|
(sound-play "grenade-hit")
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate impact (grenade)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touched)
|
|
(let ((v1-1 (as-type proc process-drawable)))
|
|
(when v1-1
|
|
(let ((a0-3 (-> v1-1 root))
|
|
(a1-2 (new 'stack-no-clear 'collide-query))
|
|
)
|
|
(let ((v1-4 (-> self root root-prim prim-core))
|
|
(a0-5 (-> (the-as collide-shape a0-3) root-prim prim-core))
|
|
)
|
|
0.0
|
|
(set! (-> a1-2 start-pos quad) (-> v1-4 world-sphere quad))
|
|
(vector-! (-> a1-2 move-dist) (-> a0-5 world-sphere) (-> v1-4 world-sphere))
|
|
)
|
|
(let ((v1-5 a1-2))
|
|
(set! (-> v1-5 radius) 40.96)
|
|
(set! (-> v1-5 collide-with) (collide-spec backgnd))
|
|
(set! (-> v1-5 ignore-process0) self)
|
|
(set! (-> v1-5 ignore-process1) #f)
|
|
(set! (-> v1-5 ignore-pat) (-> self root pat-ignore-mask))
|
|
(set! (-> v1-5 action-mask) (collide-action solid))
|
|
)
|
|
(if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0)
|
|
(send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type projectile impact) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set-time! (-> self state-time))
|
|
(send-event (handle->process (-> self end-target)) 'die)
|
|
(remove-setting! 'point-of-interest)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-set! 0)
|
|
(let ((v1-1 (-> self root root-prim)))
|
|
(set! (-> v1-1 local-sphere w) (-> self blast-radius))
|
|
(set! (-> v1-1 prim-core world-sphere w) (-> self blast-radius))
|
|
(set! (-> v1-1 prim-core collide-with)
|
|
(collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list)
|
|
)
|
|
(set! (-> v1-1 prim-core collide-as) (collide-spec enemy))
|
|
)
|
|
(update-transforms (-> self root))
|
|
(let ((a1-0 (new 'stack-no-clear 'overlaps-others-params)))
|
|
(set! (-> a1-0 options) (overlaps-others-options))
|
|
(set! (-> a1-0 collide-with-filter) (the-as collide-spec -1))
|
|
(set! (-> a1-0 tlist) *touching-list*)
|
|
(find-overlapping-shapes (-> self root) a1-0)
|
|
)
|
|
(suspend)
|
|
(let ((v1-9 (-> self root root-prim)))
|
|
(set! (-> v1-9 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-9 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
(deactivate self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate dissipate (grenade)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(go-virtual impact)
|
|
)
|
|
)
|
|
|
|
;; definition for method 40 of type grenade
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod grenade-method-40 ((this grenade))
|
|
(let ((s5-0 (the-as process-drawable (-> this end-target process 0))))
|
|
(when s5-0
|
|
(set! (-> this root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> this root trans x))))
|
|
(set! (-> this root transv z) (* 4.0 (- (-> s5-0 root trans z) (-> this root trans z))))
|
|
(let ((v1-12 (-> this root transv)))
|
|
(if (< (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) 16384.0)
|
|
(vector-xz-normalize! (-> this root transv) 16384.0)
|
|
)
|
|
)
|
|
(if (or (logtest? (-> this root status) (collide-status on-surface on-ground))
|
|
(< (vector-vector-distance (-> s5-0 root trans) (-> this root trans)) 4096.0)
|
|
)
|
|
(go (method-of-object this impact))
|
|
)
|
|
)
|
|
)
|
|
(vector-v++! (-> this root transv) (compute-acc-due-to-gravity (-> this root) (new-stack-vector0) 1.0))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 41 of type grenade
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod grenade-method-41 ((this grenade))
|
|
(quaternion*! (-> this root quat) (-> this root quat) (-> this tumble-quat))
|
|
(projectile-move-fill-all-dirs this)
|
|
(set-setting! 'point-of-interest 'abs (-> this root trans) 0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 30 of type grenade
|
|
;; WARN: Return type mismatch collide-shape-moving vs none.
|
|
(defmethod init-proj-collision! ((this grenade))
|
|
"Init the [[projectile]]'s [[collide-shape]]"
|
|
(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-projectile)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(set! (-> s5-0 penetrate-using) (penetrate explode))
|
|
(let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-7 prim-core collide-as) (collide-spec projectile))
|
|
(set! (-> v1-7 prim-core collide-with)
|
|
(collide-spec crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher)
|
|
)
|
|
(set! (-> v1-7 prim-core action) (collide-action solid))
|
|
(set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8)
|
|
(set! (-> s5-0 total-prims) (the-as uint 1))
|
|
(set! (-> s5-0 root-prim) v1-7)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-10 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with))
|
|
)
|
|
(set! (-> s5-0 max-iteration-count) (the-as uint 2))
|
|
(set! (-> s5-0 event-self) 'touched)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 31 of type grenade
|
|
(defmethod init-proj-settings! ((this grenade))
|
|
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-grenade" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(logclear! (-> this options) (projectile-options proj-options-4))
|
|
(vector-normalize! (-> this root transv) 1.0)
|
|
(+! (-> this root transv y) 1.0)
|
|
(vector-normalize! (-> this root transv) 184320.0)
|
|
(set! (-> this attack-mode) 'eco-yellow)
|
|
(set! (-> this blast-radius) 20480.0)
|
|
(set! (-> this max-speed) 184320.0)
|
|
(set! (-> this timeout) (seconds 3.6))
|
|
(set! (-> this update-velocity) (method-of-object this grenade-method-40))
|
|
(set! (-> this move) (method-of-object this grenade-method-41))
|
|
(set! (-> this root dynam gravity y) 327680.0)
|
|
(set! (-> this root dynam gravity-length) 327680.0)
|
|
(set! (-> this root dynam gravity-max) 327680.0)
|
|
(let ((f0-7 1092.2667))
|
|
(quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-7)
|
|
)
|
|
(set! (-> this end-target)
|
|
(process->handle (as-type (send-event (ppointer->process (-> this parent)) 'target) process-drawable))
|
|
)
|
|
(set! (-> this part) (create-launch-control group-grenade-armed this))
|
|
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-ecowell-a ecowell-a ecowell-a-lod0-jg -1
|
|
((ecowell-a-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 40)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-ecowell-b ecowell-b ecowell-b-lod0-jg -1
|
|
((ecowell-b-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 40)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-ecowell-c ecowell-c ecowell-c-lod0-jg -1
|
|
((ecowell-c-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 40)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-ecowell-d ecowell-d ecowell-d-lod0-jg -1
|
|
((ecowell-d-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 400)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node strip-grenade-explode)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'music 'danger10 0.0 0)
|
|
(set! (-> *game-info* controller 0) (process->handle self))
|
|
(set! (-> self entity) (the-as entity-actor (entity-by-name "grenade-point-1")))
|
|
(set! (-> self actor-group 0) (res-lump-struct (-> self entity) 'actor-groups (pointer entity-actor)))
|
|
(set-setting! 'allow-continue #f 0.0 0)
|
|
(when (-> self actor-group 0)
|
|
(dotimes (gp-0 (the-as int (-> self actor-group 0 0)))
|
|
(let ((s5-0 (-> (&+ (-> self actor-group 0) (* gp-0 8)) 3)))
|
|
(when s5-0
|
|
(toggle-status s5-0 (entity-perm-status subtask-complete) #f)
|
|
(add-icon! *minimap* self (the-as uint 16) (the-as int #f) (the-as vector s5-0) 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((v0-6 (-> self actor-group 0 0)))
|
|
(set! (-> self count) (the-as int v0-6))
|
|
v0-6
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node strip-grenade-explode)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-time! (-> self start-time))
|
|
(set! (-> self total-time) (seconds 120))
|
|
(set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*)))
|
|
(set! (-> self hud-counter) (ppointer->handle (process-spawn hud-plasmite :init hud-init-by-other :to self)))
|
|
(while (or (not (time-elapsed? (-> self start-time) (-> self total-time)))
|
|
(and *target* (focus-test? *target* in-air))
|
|
)
|
|
(let ((v1-18 (the-as int (- (-> self total-time) (- (current-time) (-> self start-time))))))
|
|
(if (< (the-as time-frame v1-18) 0)
|
|
(set! v1-18 0)
|
|
)
|
|
(set! (-> *game-info* timer) (the-as time-frame v1-18))
|
|
)
|
|
(let ((sv-16 (the-as (pointer entity-actor) (-> self actor-group 0 0))))
|
|
(when (-> self actor-group 0)
|
|
(dotimes (v1-23 (the-as int (-> self actor-group 0 0)))
|
|
(let ((a1-8 (-> (&+ (-> self actor-group 0) (* v1-23 8)) 3)))
|
|
(if (and a1-8 (logtest? (-> a1-8 extra perm status) (entity-perm-status subtask-complete)))
|
|
(&+! sv-16 -1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (!= sv-16 (-> self count))
|
|
(case sv-16
|
|
((5)
|
|
(talker-spawn-func (-> *talker-speech* 198) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((4)
|
|
(talker-spawn-func (-> *talker-speech* 199) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((3)
|
|
(talker-spawn-func (-> *talker-speech* 200) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((2)
|
|
(talker-spawn-func (-> *talker-speech* 201) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((1)
|
|
(talker-spawn-func (-> *talker-speech* 202) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
)
|
|
(set! (-> self count) (the-as int sv-16))
|
|
)
|
|
(cond
|
|
((and (>= (current-time) (+ #x80e8 (-> self start-time)))
|
|
(< (-> self state-time) (+ #x80e8 (-> self start-time)))
|
|
)
|
|
(talker-spawn-func (-> *talker-speech* 197) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((and (>= (current-time) (+ (-> self start-time) (seconds 90)))
|
|
(< (-> self state-time) (+ (-> self start-time) (seconds 90)))
|
|
)
|
|
(talker-spawn-func (-> *talker-speech* 196) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
((and (>= (current-time) (+ (-> self start-time) (seconds 60)))
|
|
(< (-> self state-time) (+ (-> self start-time) (seconds 60)))
|
|
)
|
|
(talker-spawn-func (-> *talker-speech* 195) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
)
|
|
(set-time! (-> self state-time))
|
|
(set! (-> *game-info* counter) (the float (the-as int sv-16)))
|
|
(if (>= 1 (the-as int sv-16))
|
|
(gui-control-method-12
|
|
*gui-control*
|
|
self
|
|
(gui-channel art-load)
|
|
(gui-action queue)
|
|
"ecowells-victory"
|
|
0
|
|
-1.0
|
|
(new 'static 'sound-id)
|
|
)
|
|
)
|
|
(if (not *target*)
|
|
(go-virtual fail)
|
|
)
|
|
(if (zero? sv-16)
|
|
(go-virtual complete)
|
|
)
|
|
)
|
|
(suspend)
|
|
)
|
|
(the-as entity-actor (go-virtual fail))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node strip-grenade-explode)
|
|
TASK_MANAGER_FAIL_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion))))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition of type drill-plat
|
|
(deftype drill-plat (strip-hazard)
|
|
((plat-sound ambient-sound)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type drill-plat
|
|
(defmethod inspect ((this drill-plat))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type strip-hazard inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tplat-sound: ~A~%" (-> this plat-sound))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 7 of type drill-plat
|
|
;; WARN: Return type mismatch process-drawable vs drill-plat.
|
|
(defmethod relocate ((this drill-plat) (offset int))
|
|
(if (nonzero? (-> this plat-sound))
|
|
(&+! (-> this plat-sound) offset)
|
|
)
|
|
(the-as drill-plat ((method-of-type process-drawable relocate) this offset))
|
|
)
|
|
|
|
;; definition for method 10 of type drill-plat
|
|
(defmethod deactivate ((this drill-plat))
|
|
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
|
(if (nonzero? (-> this plat-sound))
|
|
(stop! (-> this plat-sound))
|
|
)
|
|
((method-of-type process-drawable deactivate) this)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-drill-plat drill-plat drill-plat-lod0-jg drill-plat-idle-ja
|
|
((drill-plat-lod0-mg (meters 20)) (drill-plat-lod1-mg (meters 999999)))
|
|
:bounds (static-spherem 14 18 0 26)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (drill-plat)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch 'attack)
|
|
#f
|
|
)
|
|
(else
|
|
(strip-handler proc argc message block)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(rider-trans)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(let ((f0-1 (* (get-current-phase-no-mod (-> self sync)) (the float (+ (-> (ja-group) frames num-frames) -1)))))
|
|
(ja-no-eval :group! (ja-group) :num! (loop!) :frame-num f0-1)
|
|
)
|
|
(let ((f0-5 (/ (* 2.0 (ja-frame-num 0)) (the float (ja-num-frames 0)))))
|
|
(if (< 1.0 f0-5)
|
|
(set! f0-5 (+ -1.0 f0-5))
|
|
)
|
|
(let* ((f0-6 (* 3.1415925 f0-5))
|
|
(f0-7 (sin-rad f0-6))
|
|
)
|
|
(update-vol! (-> self plat-sound) (sqrtf f0-7))
|
|
)
|
|
)
|
|
(suspend)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(let ((t9-0 (-> (method-of-type strip-hazard idle) post)))
|
|
(if t9-0
|
|
((the-as (function none) t9-0))
|
|
)
|
|
)
|
|
(rider-post)
|
|
(update! (-> self sound))
|
|
(update-trans!
|
|
(-> self plat-sound)
|
|
(vector<-cspace! (new 'stack-no-clear 'vector) (joint-node drill-plat-lod0-jg plat))
|
|
)
|
|
(update! (-> self plat-sound))
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type drill-plat
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this drill-plat) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(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) 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 3) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 4))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
|
|
(set! (-> s3-0 transform-index) 0)
|
|
(set-vector! (-> s3-0 local-sphere) 61440.0 61440.0 0.0 110592.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(pusher-init s4-0)
|
|
(let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1))))
|
|
(set! (-> v1-14 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-14 prim-core action) (collide-action solid))
|
|
(set! (-> v1-14 transform-index) 0)
|
|
(set-vector! (-> v1-14 local-sphere) 40960.0 12288.0 0.0 61440.0)
|
|
)
|
|
(let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 2))))
|
|
(set! (-> v1-16 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-16 prim-core action) (collide-action solid))
|
|
(set! (-> v1-16 transform-index) 5)
|
|
(set-vector! (-> v1-16 local-sphere) 0.0 49152.0 0.0 49152.0)
|
|
)
|
|
(let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 3))))
|
|
(set! (-> v1-18 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-18 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-18 transform-index) 7)
|
|
(set-vector! (-> v1-18 local-sphere) 0.0 6553.6 0.0 26624.0)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-21 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-21 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-drill-plat" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(let ((t9-10 (method-of-type strip-hazard init-from-entity!)))
|
|
(t9-10 this arg0)
|
|
)
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(let ((a3-5 (new 'stack-no-clear 'vector)))
|
|
(set! (-> a3-5 quad) (-> this root trans quad))
|
|
(+! (-> a3-5 x) 57344.0)
|
|
(set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "drill-plat-a" :fo-max 90) a3-5))
|
|
)
|
|
(ja-post)
|
|
(set! (-> this plat-sound) (new
|
|
'process
|
|
'ambient-sound
|
|
(static-sound-spec "drill-plat-b" :fo-max 50)
|
|
(vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7))
|
|
)
|
|
)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node strip-rescue-battle)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(let ((gp-0 (new 'stack-no-clear 'task-arrow-params)))
|
|
(set! (-> gp-0 pos quad) (-> self info end-sphere quad))
|
|
(quaternion-identity! (-> gp-0 quat))
|
|
(set! (-> gp-0 flags) (task-arrow-flags))
|
|
(set! (-> gp-0 map-icon) (the-as uint 15))
|
|
(set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 self)))
|
|
)
|
|
(while (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r))
|
|
(suspend)
|
|
)
|
|
(send-event (handle->process (-> self arrow)) 'leave)
|
|
(sleep-code)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for function strip-login
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun strip-login ()
|
|
(set! *nav-network* (new 'loading-level 'nav-network))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function strip-activate
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun strip-activate ()
|
|
(setup-user-array (-> *part-id-table* 638) "flamer-part")
|
|
(setup-user-array (-> *part-id-table* 639) "flamer-part")
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function strip-deactivate
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun strip-deactivate ()
|
|
(set! *nav-network* (the-as nav-network 0))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
|
|
|
|
|