mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 02:31:30 -04:00
792 lines
24 KiB
Common Lisp
Vendored
Generated
792 lines
24 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type light-eco-child
|
|
(deftype light-eco-child (process-drawable)
|
|
((root collide-shape :override)
|
|
(angle-bit int32)
|
|
(ground-y float)
|
|
(falling-start-time time-frame)
|
|
(last-update-time time-frame)
|
|
(rot vector :inline)
|
|
(rotv vector :inline)
|
|
(traj trajectory :inline)
|
|
)
|
|
(:methods
|
|
(common-trans (_type_) none)
|
|
)
|
|
(:states
|
|
light-eco-child-appear
|
|
light-eco-child-die
|
|
light-eco-child-grabbed
|
|
light-eco-child-hit-ground
|
|
light-eco-child-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type light-eco-child
|
|
(defmethod inspect ((this light-eco-child))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tangle-bit: ~D~%" (-> this angle-bit))
|
|
(format #t "~T~Tground-y: ~f~%" (-> this ground-y))
|
|
(format #t "~T~Tfalling-start-time: ~D~%" (-> this falling-start-time))
|
|
(format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time))
|
|
(format #t "~T~Trot: #<vector @ #x~X>~%" (-> this rot))
|
|
(format #t "~T~Trotv: #<vector @ #x~X>~%" (-> this rotv))
|
|
(format #t "~T~Ttraj: #<trajectory @ #x~X>~%" (-> this traj))
|
|
this
|
|
)
|
|
|
|
;; definition of type light-eco-mother
|
|
(deftype light-eco-mother (process-drawable)
|
|
((player-got-eco? symbol)
|
|
(angle-mask int64)
|
|
(delay-til-spawn int32)
|
|
(part2 sparticle-launch-control)
|
|
(last-update-time time-frame)
|
|
(last-spawned-time time-frame)
|
|
)
|
|
(:methods
|
|
(spawn-child-eco (_type_) symbol)
|
|
(common-trans (_type_) none)
|
|
)
|
|
(:states
|
|
light-eco-mother-active
|
|
light-eco-mother-appear
|
|
light-eco-mother-discipate
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type light-eco-mother
|
|
(defmethod inspect ((this light-eco-mother))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tplayer-got-eco?: ~A~%" (-> this player-got-eco?))
|
|
(format #t "~T~Tangle-mask: ~D~%" (-> this angle-mask))
|
|
(format #t "~T~Tdelay-til-spawn: ~D~%" (-> this delay-til-spawn))
|
|
(format #t "~T~Tpart2: ~A~%" (-> this part2))
|
|
(format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time))
|
|
(format #t "~T~Tlast-spawned-time: ~D~%" (-> this last-spawned-time))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *light-eco-big-sg* light-eco light-eco-big-lod0-jg -1
|
|
((light-eco-big-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 9)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *light-eco-small-sg* light-eco light-eco-small-lod0-jg -1
|
|
((light-eco-small-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 1.5)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-light-eco-mother-growing
|
|
:id 690
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 32)
|
|
:parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2897
|
|
:init-specs ((:texture (flare effects))
|
|
(:num 0.5)
|
|
(:scale-x (meters 10.5) (meters 4.5))
|
|
(:rot-x 4)
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y (meters 2.1) (meters 1.8))
|
|
(:r 0.0 1 255.0)
|
|
(:g 0.0 1 255.0)
|
|
(:b 0.0 1 255.0)
|
|
(:a 0.0)
|
|
(:scalevel-x (meters 0.009765625))
|
|
(:rotvel-z (degrees -0.15) (degrees 0.3))
|
|
(:scalevel-y (meters 0.009765625))
|
|
(:fade-a 0.35555556)
|
|
(:timer (seconds 1))
|
|
(:flags (bit2 bit3 bit14))
|
|
(:next-time (seconds 0.3))
|
|
(:next-launcher 2899)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2899
|
|
:init-specs ((:fade-a -0.53333336))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2898
|
|
:init-specs ((:texture (flare effects))
|
|
(:num 0.06)
|
|
(:scale-x (meters 20) (meters 4.5))
|
|
(:rot-x 4)
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y (meters 1.2))
|
|
(:r 0.0 1 255.0)
|
|
(:g 0.0 1 255.0)
|
|
(:b 0.0 1 255.0)
|
|
(:a 0.0)
|
|
(:scalevel-x (meters 0.009765625))
|
|
(:rotvel-z (degrees -0.15) (degrees 0.3))
|
|
(:fade-a 0.32)
|
|
(:timer (seconds 1))
|
|
(:flags (bit2 bit3 bit14))
|
|
(:next-time (seconds 0.25))
|
|
(:next-launcher 232)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2900
|
|
:init-specs ((:texture (bigpuff effects))
|
|
(:num 0.05 0.05)
|
|
(:x (meters -0.001) (meters 0.002))
|
|
(:y (meters -0.001) (meters 0.002))
|
|
(:z (meters -0.001) (meters 0.002))
|
|
(:scale-x (meters 10) (meters 5))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 0.0)
|
|
(:vel-y (meters 0))
|
|
(:scalevel-x (meters 0.016666668))
|
|
(:rotvel-z (degrees -0.3) (degrees 0.6))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-a 0.21333334)
|
|
(:timer (seconds 2))
|
|
(:flags (bit2 bit3))
|
|
(:next-time (seconds 0.8) (seconds 0.197))
|
|
(:next-launcher 2901)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2901
|
|
:init-specs ((:fade-a -0.21333334))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2902
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 1.0 8.0)
|
|
(:scale-x (meters 0.5) (meters 0.2))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 32.0 64.0)
|
|
(:vel-y (meters 0.10666667) (meters 0.21333334))
|
|
(:scalevel-x (meters -0.00083333335))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:accel-y (meters -0.0016666667) (meters -0.00066666666))
|
|
(:friction 0.9)
|
|
(:timer (seconds 0.1) (seconds 0.497))
|
|
(:flags (bit0 bit2 bit3))
|
|
(:userdata 1638400.0)
|
|
(:func 'check-drop-level-lighteco-big-pops)
|
|
(:next-time (seconds 0.15) (seconds 0.997))
|
|
(:next-launcher 2903)
|
|
(:conerot-x (degrees 0) (degrees 180))
|
|
(:conerot-y (degrees -1440) (degrees 2880))
|
|
(:conerot-radius (meters 4))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2903
|
|
:init-specs ((:userdata 2252800.0))
|
|
)
|
|
|
|
;; definition for function check-drop-level-lighteco-big-pops
|
|
(defun check-drop-level-lighteco-big-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
|
|
(when (< (-> arg2 y) (-> arg1 user-float))
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(sp-kill-particle arg0 arg1)
|
|
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
|
|
(launch-particles (-> *part-id-table* 2904) gp-0)
|
|
(launch-particles (-> *part-id-table* 2905) gp-0)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2905
|
|
:init-specs ((:texture (starflash effects))
|
|
(:num 1.0)
|
|
(:scale-x (meters 1) (meters 0.4))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 16.0 32.0)
|
|
(:fade-a -1.92)
|
|
(:timer (seconds 0.067))
|
|
(:flags (bit2 bit3))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2904
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 4.0 4.0)
|
|
(:scale-x (meters 0.3) (meters 0.2))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 32.0 64.0)
|
|
(:vel-y (meters 0.053333335) (meters 0.053333335))
|
|
(:accel-y (meters -0.0016666667) (meters -0.00066666666))
|
|
(:friction 0.85)
|
|
(:timer (seconds 0.05) (seconds 0.397))
|
|
(:flags (bit2 bit3))
|
|
(:conerot-x (degrees 0) (degrees 360))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-light-eco-mother
|
|
:id 691
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 32)
|
|
:parts ((sp-item 2902) (sp-item 2900) (sp-item 2897) (sp-item 2898))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpartgroup group-light-eco-child
|
|
:id 692
|
|
:flags (use-local-clock)
|
|
:bounds (static-bspherem 0 0 0 4)
|
|
:parts ((sp-item 2906) (sp-item 2907))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2907
|
|
:init-specs ((:texture (bigpuff effects))
|
|
(:num 0.025 0.025)
|
|
(:x (meters -0.001) (meters 0.002))
|
|
(:y (meters -0.001) (meters 0.002))
|
|
(:z (meters -0.001) (meters 0.002))
|
|
(:scale-x (meters 2) (meters 0.5))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 0.0)
|
|
(:vel-y (meters 0))
|
|
(:scalevel-x (meters 0.006666667))
|
|
(:rotvel-z (degrees -0.3) (degrees 0.6))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:fade-a 0.85333335)
|
|
(:timer (seconds 1))
|
|
(:flags (bit2 bit3))
|
|
(:next-time (seconds 0.4) (seconds 0.097))
|
|
(:next-launcher 2908)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2908
|
|
:init-specs ((:fade-a -0.85333335))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2906
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 1.0 2.0)
|
|
(:scale-x (meters 0.15) (meters 0.3))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 32.0 64.0)
|
|
(:vel-y (meters 0.10666667) (meters 0.21333334))
|
|
(:scalevel-x (meters -0.00083333335))
|
|
(:scalevel-y :copy scalevel-x)
|
|
(:accel-y (meters -0.0016666667) (meters -0.00066666666))
|
|
(:friction 0.5)
|
|
(:timer (seconds 0.1) (seconds 0.497))
|
|
(:flags (bit0 bit2 bit3))
|
|
(:userdata 1638400.0)
|
|
(:func 'check-drop-level-lighteco-pops)
|
|
(:next-time (seconds 0.15) (seconds 0.997))
|
|
(:next-launcher 2909)
|
|
(:conerot-x (degrees 0) (degrees 180))
|
|
(:conerot-y (degrees -1440) (degrees 2880))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2909
|
|
:init-specs ((:userdata 2048000.0))
|
|
)
|
|
|
|
;; definition for function check-drop-level-lighteco-pops
|
|
(defun check-drop-level-lighteco-pops ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
|
|
(when (< (-> arg2 y) (-> arg1 user-float))
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(sp-kill-particle arg0 arg1)
|
|
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
|
|
(launch-particles (-> *part-id-table* 2910) gp-0)
|
|
(launch-particles (-> *part-id-table* 2911) gp-0)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2911
|
|
:init-specs ((:texture (starflash effects))
|
|
(:num 1.0)
|
|
(:scale-x (meters 1) (meters 0.4))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y :copy scale-x)
|
|
(:r 255.0)
|
|
(:g 255.0)
|
|
(:b 255.0)
|
|
(:a 16.0 32.0)
|
|
(:fade-a -1.92)
|
|
(:timer (seconds 0.067))
|
|
(:flags (bit2 bit3))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defpart 2910
|
|
:init-specs ((:texture (hotdot effects))
|
|
(:num 4.0 4.0)
|
|
(:scale-x (meters 0.1) (meters 0.2))
|
|
(:scale-y :copy scale-x)
|
|
(:r 192.0 64.0)
|
|
(:g 192.0 64.0)
|
|
(:b 192.0 64.0)
|
|
(:a 32.0 64.0)
|
|
(:vel-y (meters 0.053333335) (meters 0.053333335))
|
|
(:accel-y (meters -0.0016666667) (meters -0.00066666666))
|
|
(:friction 0.85)
|
|
(:timer (seconds 0.05) (seconds 0.397))
|
|
(:flags (bit2 bit3))
|
|
(:conerot-x (degrees 0) (degrees 360))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
;; definition for function light-eco-child-default-event-handler
|
|
(defbehavior light-eco-child-default-event-handler light-eco-child ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(case arg2
|
|
(('touch 'attack)
|
|
(when (= (-> arg0 type) target)
|
|
(send-event (ppointer->process (-> self parent)) 'trigger (-> self angle-bit))
|
|
(go light-eco-child-grabbed)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 20 of type light-eco-child
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod common-trans ((this light-eco-child))
|
|
(let ((v1-1 (current-time)))
|
|
(when (!= v1-1 (-> this last-update-time))
|
|
(set! (-> this last-update-time) v1-1)
|
|
(let* ((s5-0 (new 'stack-no-clear 'vector))
|
|
(s4-0 (-> this rot))
|
|
(f30-0 (-> s4-0 w))
|
|
)
|
|
(vector-v++! s4-0 (-> this rotv))
|
|
(set! (-> s4-0 w) (+ f30-0 (* (-> this rotv w) (seconds-per-frame))))
|
|
(set-vector! s5-0 (cos (-> s4-0 x)) (cos (-> s4-0 y)) (cos (-> s4-0 z)) 1.0)
|
|
(vector-normalize! s5-0 1.0)
|
|
(quaternion-vector-angle! (-> this root quat) s5-0 f30-0)
|
|
)
|
|
(spawn (-> this part) (-> this root trans))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-child-appear (light-eco-child)
|
|
:event light-eco-child-default-event-handler
|
|
:enter (behavior ()
|
|
(set-time! (-> self falling-start-time))
|
|
)
|
|
:trans (behavior ()
|
|
(let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time))))
|
|
(eval-position! (-> self traj) f30-0 (-> self root trans))
|
|
(if (= f30-0 (-> self traj time))
|
|
(go light-eco-child-hit-ground)
|
|
)
|
|
)
|
|
(common-trans self)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
)
|
|
:post transform-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-child-hit-ground (light-eco-child)
|
|
:event light-eco-child-default-event-handler
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
)
|
|
:trans (behavior ()
|
|
(let ((f30-0 (+ (-> self root transv y) (* -544768.0 (seconds-per-frame)))))
|
|
(when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root trans y)))
|
|
(if (>= 4096.0 (fabs f30-0))
|
|
(go light-eco-child-idle)
|
|
)
|
|
(set! (-> self root transv y) 0.0)
|
|
(vector-normalize! (-> self root transv) (* 0.25 (vector-xz-length (-> self root transv))))
|
|
(set! f30-0 (* 0.35 (- f30-0)))
|
|
)
|
|
(set! (-> self root transv y) f30-0)
|
|
)
|
|
(vector-v+! (-> self root trans) (-> self root trans) (-> self root transv))
|
|
(let ((f0-8
|
|
(vector-vector-xz-distance (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans))
|
|
)
|
|
)
|
|
(when (< 92610.56 f0-8)
|
|
(let ((gp-1 (new 'stack-no-clear 'vector)))
|
|
(vector-! gp-1 (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans))
|
|
(set! (-> gp-1 y) 0.0)
|
|
(vector-normalize! gp-1 92610.56)
|
|
(vector+! gp-1 gp-1 (-> (the-as light-eco-mother (-> self parent 0)) root trans))
|
|
(set! (-> gp-1 y) (-> self root trans y))
|
|
(set! (-> self root trans quad) (-> gp-1 quad))
|
|
)
|
|
)
|
|
)
|
|
(common-trans self)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
)
|
|
:post transform-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-child-idle (light-eco-child)
|
|
:event light-eco-child-default-event-handler
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
)
|
|
:trans (behavior ()
|
|
(if (time-elapsed? (-> self state-time) (seconds 4))
|
|
(go light-eco-child-die)
|
|
)
|
|
(common-trans self)
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
)
|
|
:post transform-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-child-die (light-eco-child)
|
|
:code (behavior ()
|
|
(send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit))
|
|
(clear-collide-with-as (-> self root))
|
|
(logior! (-> self draw status) (draw-status hidden))
|
|
(set-time! (-> self state-time))
|
|
(until (time-elapsed? (-> self state-time) (seconds 0.1))
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-child-grabbed (light-eco-child)
|
|
:code (behavior ()
|
|
(suspend)
|
|
0
|
|
)
|
|
)
|
|
|
|
;; definition for function light-eco-child-init-by-other
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defbehavior light-eco-child-init-by-other light-eco-child ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 int))
|
|
(set! (-> self entity) arg0)
|
|
(set! (-> self angle-bit) arg3)
|
|
(set! (-> self ground-y) (-> arg2 y))
|
|
(set! (-> self last-update-time) 0)
|
|
(set-vector!
|
|
(-> self rotv)
|
|
(rand-vu-float-range 5898.24 9539.129)
|
|
(rand-vu-float-range 5552.3555 9193.244)
|
|
(rand-vu-float-range 6007.467 9648.355)
|
|
(rand-vu-float-range 11013.688 18295.467)
|
|
)
|
|
(set-vector!
|
|
(-> self rot)
|
|
(rand-vu-float-range 0.0 65536.0)
|
|
(rand-vu-float-range 0.0 65536.0)
|
|
(rand-vu-float-range 0.0 65536.0)
|
|
(rand-vu-float-range 0.0 65536.0)
|
|
)
|
|
(let ((s4-2 (new 'process 'collide-shape self (collide-list-enum hit-by-player))))
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-2 (the-as uint 0))))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-kind wall-object))
|
|
(set! (-> s3-0 collide-with) (collide-kind target))
|
|
(set! (-> s3-0 prim-core offense) (collide-offense no-offense))
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 4096.0)
|
|
(set-root-prim! s4-2 s3-0)
|
|
)
|
|
(set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w)))
|
|
(backup-collide-with-as s4-2)
|
|
(set! (-> self root) s4-2)
|
|
)
|
|
(set! (-> self root trans quad) (-> arg1 quad))
|
|
(set-vector! (-> self root scale) 2.0 2.0 2.0 1.0)
|
|
(quaternion-identity! (-> self root quat))
|
|
(setup-from-to-height! (-> self traj) (-> self root trans) arg2 4096.0 -4.551111)
|
|
(let ((s4-3 (-> self root transv)))
|
|
(vector-! s4-3 arg2 arg1)
|
|
(set! (-> s4-3 y) 0.0)
|
|
(vector-normalize! s4-3 163840.0)
|
|
(set! (-> s4-3 y) -122880.0)
|
|
)
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
(initialize-skeleton self *light-eco-small-sg* '())
|
|
(ja-channel-set! 1)
|
|
(ja-no-eval :num! (seek!))
|
|
(ja :group! light-eco-small-idle-ja :num! min)
|
|
(set! (-> self part) (create-launch-control group-light-eco-child self))
|
|
(transform-post)
|
|
(go light-eco-child-appear)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 21 of type light-eco-mother
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod common-trans ((this light-eco-mother))
|
|
(let ((v1-1 (current-time)))
|
|
(when (!= v1-1 (-> this last-update-time))
|
|
(set! (-> this last-update-time) v1-1)
|
|
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
|
(set-vector!
|
|
s5-0
|
|
(cos (* 25.700392 (the float (mod (current-time) 2550))))
|
|
(cos (* 24.59229 (the float (mod (current-time) 2664))))
|
|
(cos (* 26.121408 (the float (mod (current-time) 2508))))
|
|
1.0
|
|
)
|
|
(vector-normalize! s5-0 1.0)
|
|
(quaternion-vector-angle! (-> this root quat) s5-0 (* 48.860058 (the float (mod (current-time) 1341))))
|
|
)
|
|
(cond
|
|
((and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))
|
|
(set-time! (-> this last-spawned-time))
|
|
(set! (-> this delay-til-spawn) 2400)
|
|
)
|
|
(else
|
|
(when (time-elapsed? (-> this last-spawned-time) (-> this delay-til-spawn))
|
|
(when (spawn-child-eco this)
|
|
(set-time! (-> this last-spawned-time))
|
|
(set! (-> this delay-til-spawn) (rand-vu-int-range 300 600))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(update! (-> this sound))
|
|
0
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 20 of type light-eco-mother
|
|
(defmethod spawn-child-eco ((this light-eco-mother))
|
|
(countdown (s3-0 4)
|
|
(let ((gp-0 (rand-vu-int-count 32)))
|
|
(when (not (logtest? (-> this angle-mask) (ash 1 gp-0)))
|
|
(let ((f28-0 (* 2048.0 (the float gp-0)))
|
|
(f30-0 (rand-vu-float-range 61440.0 88514.56))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set-vector! s4-0 (* (sin f28-0) f30-0) 0.0 (* (cos f28-0) f30-0) 1.0)
|
|
(vector+! s4-0 s4-0 (-> this root trans))
|
|
(set! (-> s4-0 y) 1974272.0)
|
|
(when (or (not *target*) (>= (vector-vector-xz-distance s4-0 (target-pos 0)) 49152.0))
|
|
(logior! (-> this angle-mask) (ash 1 gp-0))
|
|
(process-spawn light-eco-child (-> this entity) (-> this root trans) s4-0 gp-0 :to this)
|
|
(return #t)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
|
|
;; definition for function light-eco-mother-default-event-handler
|
|
(defbehavior light-eco-mother-default-event-handler light-eco-mother ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(the-as
|
|
int
|
|
(case arg2
|
|
(('untrigger)
|
|
(the-as int (when (= (-> arg0 type) light-eco-child)
|
|
(let* ((a1-3 (-> arg3 param 0))
|
|
(v0-0 (logxor (-> self angle-mask) (ash 1 a1-3)))
|
|
)
|
|
(set! (-> self angle-mask) v0-0)
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('trigger)
|
|
(the-as int (when (not (-> self player-got-eco?))
|
|
(set! (-> self player-got-eco?) #t)
|
|
(the-as int (send-event (ppointer->process (-> self parent)) 'white-eco-picked-up))
|
|
)
|
|
)
|
|
)
|
|
(('beam-off)
|
|
(the-as int (go light-eco-mother-discipate))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-mother-appear (light-eco-mother)
|
|
:event light-eco-mother-default-event-handler
|
|
:trans (behavior ()
|
|
(common-trans self)
|
|
(spawn (-> self part2) (-> self root trans))
|
|
)
|
|
:code (behavior ()
|
|
(while (!= (-> self root scale x) 12.0)
|
|
(let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (seconds-per-frame)) 0.25 0.001)))
|
|
(set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0)
|
|
)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(go light-eco-mother-active)
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-mother-active (light-eco-mother)
|
|
:event light-eco-mother-default-event-handler
|
|
:trans (behavior ()
|
|
(common-trans self)
|
|
(spawn (-> self part) (-> self root trans))
|
|
0
|
|
)
|
|
:code (behavior ()
|
|
(loop
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate light-eco-mother-discipate (light-eco-mother)
|
|
:event light-eco-mother-default-event-handler
|
|
:trans (behavior ()
|
|
(common-trans self)
|
|
)
|
|
:code (behavior ()
|
|
(while (!= (-> self root scale x) 0.0)
|
|
(let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (seconds-per-frame)) 0.5 0.001)))
|
|
(set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0)
|
|
)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(logior! (-> self draw status) (draw-status hidden))
|
|
(until (not (-> self child))
|
|
(suspend)
|
|
)
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; definition for method 10 of type light-eco-mother
|
|
(defmethod deactivate ((this light-eco-mother))
|
|
(if (nonzero? (-> this part2))
|
|
(kill-and-free-particles (-> this part2))
|
|
)
|
|
((method-of-type projectile deactivate) (the-as projectile this))
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 7 of type light-eco-mother
|
|
;; INFO: Return type mismatch projectile vs light-eco-mother.
|
|
(defmethod relocate ((this light-eco-mother) (offset int))
|
|
(if (nonzero? (-> this part2))
|
|
(&+! (-> this part2) offset)
|
|
)
|
|
(the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile this) offset))
|
|
)
|
|
|
|
;; definition for function light-eco-mother-init-by-other
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity-actor) (arg1 vector))
|
|
(set! (-> self entity) arg0)
|
|
(set! (-> self last-update-time) 0)
|
|
(set-time! (-> self last-spawned-time))
|
|
(set! (-> self delay-til-spawn) 2400)
|
|
(set! (-> self angle-mask) 0)
|
|
(set! (-> self player-got-eco?) #f)
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(set! (-> self root trans quad) (-> arg1 quad))
|
|
(vector-reset! (-> self root scale))
|
|
(quaternion-identity! (-> self root quat))
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
(initialize-skeleton self *light-eco-big-sg* '())
|
|
(ja-channel-set! 1)
|
|
(ja-no-eval :num! (seek!))
|
|
(ja :group! light-eco-big-idle-ja :num! min)
|
|
(set! (-> self part) (create-launch-control group-light-eco-mother self))
|
|
(set! (-> self part2) (create-launch-control group-light-eco-mother-growing self))
|
|
(set! (-> self sound)
|
|
(new 'process 'ambient-sound (static-sound-spec "white-eco-lp" :fo-min 300 :fo-max 400) (-> self root trans))
|
|
)
|
|
(ja-post)
|
|
(let ((f0-4 0.0))
|
|
(countdown (v1-33 4)
|
|
(let ((a2-4 (the int (/ f0-4 (meters 0.5)))))
|
|
(logior! (-> self angle-mask) (ash 1 a2-4))
|
|
)
|
|
(set! f0-4 (+ 16384.0 f0-4))
|
|
)
|
|
)
|
|
(go light-eco-mother-appear)
|
|
(none)
|
|
)
|