jak-project/goal_src/jak2/engine/common_objs/powerups.gc
Hat Kid 8d28bb3480
jak2: add current-time macro for process clocks (#2662)
Closes #1872

---------

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-05-18 21:33:46 +01:00

1160 lines
40 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: powerups.gc
;; name in dgo: powerups
;; dgos: ENGINE, GAME
;; DECOMP BEGINS
;; WARN: Return type mismatch symbol vs none.
;; WARN: new jak 2 until loop case, check carefully
(defbehavior cloud-track process ((arg0 process-tree)
(arg1 process-tree)
(arg2 (function vector none))
(arg3 time-frame)
(arg4 time-frame)
(arg5 time-frame)
)
(change-parent self arg0)
(let ((s1-1 (process->handle arg0))
(s2-1 (process->handle arg1))
)
(let ((s0-0 (current-time)))
(until (>= (- (current-time) s0-0) (+ arg3 arg4))
(let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1)))))
(if v1-8
(deactivate self)
)
)
(let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4)))))
(a0-18 (process-drawable-pair-random-point!
(the-as process-drawable (-> s1-1 process 0))
(the-as process-drawable (-> s2-1 process 0))
(new-stack-vector0)
f0-1
)
)
)
(arg2 a0-18)
)
(suspend)
)
)
(cond
((zero? arg5)
(until #f
(suspend)
)
#f
)
(else
(let ((s4-1 (current-time)))
(until (>= (- (current-time) s4-1) arg5)
(let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0))))
(arg2 a0-21)
)
(suspend)
)
)
)
)
)
(none)
)
(defpart 539
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 64.0)
(:g 64.0)
(:b 192.0)
(:a 64.0)
(:fade-a -1.0666667)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 540
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 64.0)
(:g 64.0)
(:b 192.0)
(:a 64.0)
(:fade-a -1.0666667)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 541
:init-specs ((:texture (new 'static 'texture-id :index #x9b :page #xb))
(:num 1.0 3.0)
(:scale-x (meters 0.5) (meters 1.5))
(:rot-x 4)
(:rot-z (degrees 0) (degrees 360))
(:scale-y (meters 0.2) (meters 0.1))
(:r 64.0)
(:g 64.0)
(:b 128.0)
(:a 128.0)
(:fade-a -1.6)
(:timer (seconds 0.3))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.035))
(:next-launcher 542)
)
)
(defpart 543
:init-specs ((:texture (new 'static 'texture-id :index #x9b :page #xb))
(:num 0.0 3.0)
(:scale-x (meters 1.5) (meters 1.5))
(:rot-x 4)
(:rot-z (degrees 0) (degrees 360))
(:scale-y (meters 0.2) (meters 0.1))
(:r 128.0)
(:g 128.0)
(:b 255.0)
(:a 128.0)
(:fade-a -1.6)
(:timer (seconds 0.305))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.035))
(:next-launcher 542)
)
)
(defpart 542
:init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.0) (:fade-g -0.4) (:fade-a -2.0))
)
(defpart 544
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 1.0)
(:scale-x (meters 0.1) (meters 0.15))
(:scale-y :copy scale-x)
(:r 32.0)
(:g 32.0 64.0)
(:b 192.0 64.0)
(:a 64.0 128.0)
(:scalevel-x (meters -0.00033333333))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.2)
(:accel-y (meters -0.000016666667))
(:timer (seconds 1.5))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
)
)
(defpartgroup group-blue-hit-ground-effect
:id 123
:duration (seconds 0.017)
:linger-duration (seconds 1.5)
:bounds (static-bspherem 0 0 0 2)
:parts ((sp-item 545) (sp-item 546) (sp-item 547 :flags (is-3d)) (sp-item 548) (sp-item 549 :flags (is-3d)))
)
(defpart 548
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 32.0)
(:y (meters 0.5))
(:scale-x (meters 1) (meters 3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 0.0 63 1.0)
(:vel-y (meters 0.093333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:timer (seconds 0.5))
(:flags (sp-cpuinfo-flag-3))
(:next-time (seconds 0.067) (seconds 0.065))
(:next-launcher 550)
(:conerot-x (degrees 90))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0))
)
)
(defpart 550
:init-specs ((:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 0.0 63 1.0)
(:next-time (seconds 0.067) (seconds 0.065))
(:next-launcher 550)
)
)
(defpart 549
:init-specs ((:texture (new 'static 'texture-id :index #x2c :page #xc))
(:num 1.0)
(:y (meters 0.5))
(:scale-x (meters 0))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 96.0 32.0)
(:scalevel-x (meters 0.21333334))
(:scalevel-y :copy scalevel-x)
(:timer (seconds 0.4))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat))
(:next-time (seconds 0.2))
(:next-launcher 551)
)
)
(defpart 551
:init-specs ((:fade-a -2.1333334))
)
(defpart 547
:init-specs ((:texture (new 'static 'texture-id :index #x26 :page #xc))
(:num 1.0)
(:y (meters 0.5))
(:scale-x (meters 0))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 32.0 32.0)
(:scalevel-x (meters 0.22666667))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.7111111)
(:timer (seconds 0.3))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat))
(:next-time (seconds 0.15))
(:next-launcher 552)
)
)
(defpart 552
:init-specs ((:fade-a -1.4222223))
)
(defpart 545
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 32.0)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 16.0 32.0)
(:vel-y (meters 0.053333335) (meters 0.026666667))
(:scalevel-x (meters 0.0033333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.16)
(:accel-y (meters -0.00033333333))
(:friction 0.95)
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12))
(:conerot-x (degrees 60) (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 546
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 12.0)
(:scale-x (meters 0.5) (meters 0.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 32.0 32.0)
(:b 192.0 63.0)
(:a 16.0 16.0)
(:vel-y (meters 0.10666667) (meters 0.053333335))
(:scalevel-x (meters 0.0016666667))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.21333334)
(:accel-y (meters -0.00033333333))
(:friction 0.95)
(:timer (seconds 0.5))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12))
(:conerot-x (degrees 60) (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 553
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 92.0 32.0)
(:g 32.0 92.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 554
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 92.0 32.0)
(:g 32.0 92.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 555
:init-specs ((:texture (new 'static 'texture-id :index #xc9 :page #xc))
(:num 0.5 2.0)
(:y (meters -0.05))
(:scale-x (meters 0.2) (meters 0.1))
(:scale-y :copy scale-x)
(:r 100.0 28.0)
(:g 64.0 64.0)
(:b 0.0)
(:a 64.0 64.0)
(:vel-y (meters 0.0023333333) (meters 0.0016666667))
(:scalevel-x (meters -0.00083333335))
(:scalevel-y :copy scalevel-x)
(:fade-g -0.4)
(:fade-a -0.024242423)
(:accel-y (meters -0.000100000005) (meters -0.0003))
(:friction 0.93)
(:timer (seconds 0.1) (seconds 0.697))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.3))
(:next-launcher 556)
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.05))
)
)
(defpart 556
:init-specs ((:fade-r 0.0))
)
(defpart 557
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 92.0 32.0)
(:g 0.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 558
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 92.0 32.0)
(:g 0.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 559
:init-specs ((:texture (new 'static 'texture-id :index #xc9 :page #xc))
(:num 0.5 2.0)
(:y (meters -0.05))
(:scale-x (meters 0.2) (meters 0.1))
(:scale-y :copy scale-x)
(:r 100.0 28.0)
(:g 0.0)
(:b 0.0)
(:a 64.0 64.0)
(:vel-y (meters 0.0023333333) (meters 0.0016666667))
(:scalevel-x (meters -0.00083333335))
(:scalevel-y :copy scalevel-x)
(:fade-g -0.4)
(:fade-a -0.024242423)
(:accel-y (meters -0.000100000005) (meters -0.0003))
(:friction 0.93)
(:timer (seconds 0.1) (seconds 0.697))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.3))
(:next-launcher 560)
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.05))
)
)
(defpart 560
:init-specs ((:fade-r 0.0))
)
(defpart 561
:init-specs ((:texture (new 'static 'texture-id :index #x29 :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 92.0 32.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 562
:init-specs ((:texture (new 'static 'texture-id :page #xc))
(:num 1.0 1.0)
(:scale-x (meters 1.5) (meters 0.4))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 92.0 32.0)
(:b 0.0)
(:a 64.0)
(:fade-a -1.0)
(:timer (seconds 0.2))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
(defpart 563
:init-specs ((:texture (new 'static 'texture-id :index #xc9 :page #xc))
(:num 0.5 2.0)
(:y (meters -0.05))
(:scale-x (meters 0.2) (meters 0.1))
(:scale-y :copy scale-x)
(:r 0.0)
(:g 100.0 28.0)
(:b 0.0)
(:a 64.0 64.0)
(:vel-y (meters 0.0023333333) (meters 0.0016666667))
(:scalevel-x (meters -0.00083333335))
(:scalevel-y :copy scalevel-x)
(:fade-g -0.4)
(:fade-a -0.024242423)
(:accel-y (meters -0.000100000005) (meters -0.0003))
(:friction 0.93)
(:timer (seconds 0.1) (seconds 0.697))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.3))
(:next-launcher 564)
(:conerot-x (degrees 0) (degrees 180))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.05))
)
)
(defpart 564
:init-specs ((:fade-g 0.0))
)
(defun eco-blue-glow ((arg0 vector))
(let ((t9-0 sp-launch-particles-var)
(a0-1 *sp-particle-system-2d*)
(a1-0 (-> *part-id-table* 539))
(a2-0 *launch-matrix*)
)
(set! (-> a2-0 trans quad) (-> arg0 quad))
(t9-0 a0-1 a1-0 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(when (rand-vu-percent? 0.5)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-1 (-> *part-id-table* 541))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> arg0 quad))
(t9-2 a0-3 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
0
(none)
)
(defbehavior target-eco-process target ()
(when (and (!= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 0.0)
(>= (- (-> *display* game-clock frame-counter)
(-> (the-as fact-info-target (-> self fact-override)) eco-pickup-time)
)
(-> (the-as fact-info-target (-> self fact-override)) eco-timeout)
)
)
(set! (-> (the-as fact-info-target (-> self fact-override)) eco-level) 0.0)
(set! (-> (the-as fact-info-target (-> self fact-override)) eco-timeout) 0)
(logclear! (-> self state-flags) (state-flags sf4))
(send-event self 'reset-collide)
(stop! (-> self sound))
)
(if (logtest? (-> self game secrets) (game-secrets endless-dark))
(set! (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default))
)
(when (and (< 0.0 (-> (the-as fact-info-target (-> self fact-override)) eco-level))
(not (focus-test? self in-head))
(not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)))
(not (movie?))
(rand-vu-percent? (lerp-scale
0.0
1.0
(the float (- (-> (the-as fact-info-target (-> self fact-override)) eco-timeout)
(- (-> *display* game-clock frame-counter)
(-> (the-as fact-info-target (-> self fact-override)) eco-pickup-time)
)
)
)
0.0
900.0
)
)
)
(case (-> (the-as fact-info-target (-> self fact-override)) eco-type)
((1)
(change-sound! (-> self sound) (static-sound-name "yel-eco-jak"))
(let ((s1-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(gp-1 sp-launch-particles-var)
(s5-0 *sp-particle-system-2d*)
(s4-0 (-> *part-id-table* (if (rand-vu-percent? 0.5)
553
554
)
)
)
(s2-0 *launch-matrix*)
)
(set! (-> s2-0 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-0)) quad)
)
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(dotimes (gp-2 2)
(let ((v1-53 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(s5-1 sp-launch-particles-var)
(s4-1 *sp-particle-system-2d*)
(s3-1 (-> *part-id-table* 555))
(s1-1 *launch-matrix*)
)
(set! (-> s1-1 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-53)) quad)
)
(s5-1 s4-1 s3-1 s1-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
((2)
(target-danger-set! (-> self control danger-mode) 'eco-red)
(update-transforms (-> self control))
(let ((a1-13 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-13 options) (overlaps-others-options))
(set! (-> a1-13 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-13 tlist) *touching-list*)
(find-overlapping-shapes (-> self control) a1-13)
)
(target-danger-set! (-> self control danger-mode) #f)
(update-transforms (-> self control))
(change-sound! (-> self sound) (static-sound-name "red-eco-jak"))
(let ((s1-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(gp-3 sp-launch-particles-var)
(s5-2 *sp-particle-system-2d*)
(s4-2 (-> *part-id-table* (if (rand-vu-percent? 0.5)
557
558
)
)
)
(s2-2 *launch-matrix*)
)
(set! (-> s2-2 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-2)) quad)
)
(gp-3 s5-2 s4-2 s2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(dotimes (gp-4 2)
(let ((v1-86 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(s5-3 sp-launch-particles-var)
(s4-3 *sp-particle-system-2d*)
(s3-3 (-> *part-id-table* 559))
(s1-3 *launch-matrix*)
)
(set! (-> s1-3 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-86)) quad)
)
(s5-3 s4-3 s3-3 s1-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
((3)
(change-sound! (-> self sound) (static-sound-name "blue-eco-jak"))
(let ((v1-99 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(cond
((and (logtest? (-> self control mod-surface flags) (surface-flag air))
(not (logtest? (-> self control status) (collide-status on-surface)))
)
(set! (-> *part-id-table* 543 init-specs 4 initial-valuef) 0.0)
(set! (-> *part-id-table* 543 init-specs 4 random-rangef) 65536.0)
)
(else
(set! (-> *part-id-table* 543 init-specs 4 initial-valuef) 40960.0)
(set! (-> *part-id-table* 543 init-specs 4 random-rangef) 16384.0)
)
)
(let ((gp-5 sp-launch-particles-var)
(s5-4 *sp-particle-system-2d*)
(s4-4 (-> *part-id-table* 543))
(s2-4 *launch-matrix*)
)
(set! (-> s2-4 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-99)) quad)
)
(gp-5 s5-4 s4-4 s2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
(let ((gp-6 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(let ((s5-5 sp-launch-particles-var)
(s4-5 *sp-particle-system-2d*)
(s3-5 (-> *part-id-table* (if (rand-vu-percent? 0.5)
539
540
)
)
)
(s1-4 *launch-matrix*)
)
(set! (-> s1-4 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6)) quad)
)
(s5-5 s4-5 s3-5 s1-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(when (rand-vu-percent? 0.5)
(let ((s5-6 sp-launch-particles-var)
(s4-6 *sp-particle-system-2d*)
(s3-6 (-> *part-id-table* 541))
(s1-5 *launch-matrix*)
)
(set! (-> s1-5 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6)) quad)
)
(s5-6 s4-6 s3-6 s1-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
(let ((v1-123 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(gp-7 sp-launch-particles-var)
(s5-7 *sp-particle-system-2d*)
(s4-7 (-> *part-id-table* 544))
(s2-7 *launch-matrix*)
)
(set! (-> s2-7 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-123)) quad)
)
(gp-7 s5-7 s4-7 s2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1))
)
((5)
(change-sound! (-> self sound) (static-sound-name "green-eco-jak"))
(let ((s1-6 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(gp-8 sp-launch-particles-var)
(s5-8 *sp-particle-system-2d*)
(s4-8 (-> *part-id-table* (if (rand-vu-percent? 0.5)
561
562
)
)
)
(s2-8 *launch-matrix*)
)
(set! (-> s2-8 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-6)) quad)
)
(gp-8 s5-8 s4-8 s2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(dotimes (gp-9 2)
(let ((v1-147 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(s5-9 sp-launch-particles-var)
(s4-9 *sp-particle-system-2d*)
(s3-9 (-> *part-id-table* 563))
(s1-7 *launch-matrix*)
)
(set! (-> s1-7 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-147)) quad)
)
(s5-9 s4-9 s3-9 s1-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
)
(update-trans! (-> self sound) (-> self control trans))
(update! (-> self sound))
)
0
(none)
)
(defbehavior target-color-effect-process target ()
(when (and (-> self color-effect)
(>= (- (current-time) (-> self color-effect-start-time)) (the-as time-frame (-> self color-effect-duration)))
)
(set! (-> self color-effect) #f)
(set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0)
(set! (-> self draw color-emissive quad) (the-as uint128 0))
)
(case (-> self color-effect)
(('shock)
(let ((f0-4 (rand-vu-float-range 0.5 2.0)))
(set-vector! (-> self draw color-mult) f0-4 f0-4 (+ 0.5 f0-4) 1.0)
)
)
(('eco-pill-dark)
(let ((f30-0 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.3 f30-0) (lerp 0.0 0.0 f30-0) (lerp 0.0 0.3 f30-0) 1.0)
)
)
(('ammo-yellow)
(let ((f30-1 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 1.0 f30-1) (lerp 1.0 1.0 f30-1) (lerp 1.0 0.0 f30-1) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.3 f30-1) (lerp 0.0 0.3 f30-1) (lerp 0.0 0.0 f30-1) 1.0)
)
)
(('ammo-red)
(let ((f30-2 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 1.0 f30-2) (lerp 1.0 0.6 f30-2) (lerp 1.0 0.6 f30-2) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.3 f30-2) (lerp 0.0 0.0 f30-2) (lerp 0.0 0.0 f30-2) 1.0)
)
)
(('ammo-blue)
(let ((f30-3 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 0.6 f30-3) (lerp 1.0 0.8 f30-3) (lerp 1.0 1.0 f30-3) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.0 f30-3) (lerp 0.0 0.1 f30-3) (lerp 0.0 0.3 f30-3) 1.0)
)
)
(('ammo-dark)
(let ((f30-4 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 1.0 f30-4) (lerp 1.0 0.7 f30-4) (lerp 1.0 0.8 f30-4) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.2 f30-4) (lerp 0.0 0.0 f30-4) (lerp 0.0 0.1 f30-4) 1.0)
)
)
(('health)
(let ((f30-5 (lerp-scale
1.0
0.0
(the float (- (current-time) (-> self color-effect-start-time)))
(* 0.25 (the float (-> self color-effect-duration)))
(the float (-> self color-effect-duration))
)
)
)
(set-vector! (-> self draw color-mult) (lerp 1.0 0.5 f30-5) (lerp 1.0 1.0 f30-5) (lerp 1.0 0.5 f30-5) 1.0)
(set-vector! (-> self draw color-emissive) (lerp 0.0 0.0 f30-5) (lerp 0.0 0.5 f30-5) (lerp 0.0 0.0 f30-5) 1.0)
)
)
)
0
(none)
)
(defbehavior target-powerup-process target ()
(let ((f30-0 (-> self control collision-spheres 0 prim-core world-sphere w)))
(if (focus-test? self board)
(set! (-> self control collision-spheres 0 prim-core world-sphere w)
(+ 4096.0 (-> self control collision-spheres 0 prim-core world-sphere w))
)
)
(water-control-method-10 (-> self water))
(set! (-> self control collision-spheres 0 prim-core world-sphere w) f30-0)
)
(if (and (logtest? (-> self water flags) (water-flags under-water))
(not (logtest? (-> self water flags) (water-flags swim-ground)))
)
(set! (-> self control unknown-time-frame26) (current-time))
(set! (-> self control unknown-time-frame27) (current-time))
)
(cond
((and (= (-> self control ground-pat material) (pat-material ice))
(and (>= (-> self control ctrl-xz-vel) 204.8)
(< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.05))
)
)
(let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 38))))
(when (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
)
(let ((t9-3 sp-launch-particles-var)
(a0-15 *sp-particle-system-3d*)
(a1-2 (-> *part-id-table* 165))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> gp-0 quad))
(t9-3 a0-15 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
(let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 31))))
(when (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
)
(let ((t9-6 sp-launch-particles-var)
(a0-19 *sp-particle-system-3d*)
(a1-5 (-> *part-id-table* 165))
(a2-5 *launch-matrix*)
)
(set! (-> a2-5 trans quad) (-> gp-1 quad))
(t9-6 a0-19 a1-5 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
(let ((f0-10 (lerp-scale 0.8 1.0 (-> self control ctrl-xz-vel) 0.0 81920.0)))
(let ((v1-64 (ja-group)))
(if (not (and v1-64 (= v1-64 (-> self draw art-group data 110))))
(set! f0-10 (* 0.8 f0-10))
)
)
(seek! (-> self control unknown-float45) f0-10 (-> self clock seconds-per-frame))
)
(let ((f30-1 (-> self control unknown-float45))
(f0-14 (lerp-scale -0.3 0.3 (-> self control ctrl-xz-vel) 0.0 81920.0))
)
(sound-play-by-name
(static-sound-name "ice-loop")
(-> self control unknown-sound-id04)
(the int (* 1024.0 f30-1))
(the int (* 1524.0 f0-14))
0
(sound-group sfx)
(-> self control trans)
)
)
)
((< 0.0 (-> self control unknown-float45))
(set! (-> self control unknown-float45) 0.0)
(let ((v1-85 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> v1-85 command) (sound-command set-param))
(set! (-> v1-85 id) (-> self control unknown-sound-id04))
(set! (-> v1-85 params volume) -4)
(set! (-> v1-85 auto-time) 48)
(set! (-> v1-85 auto-from) 2)
(set! (-> v1-85 params mask) (the-as uint 17))
(-> v1-85 id)
)
)
)
(target-darkjak-process)
(when (nonzero? (-> (the-as fact-info-target (-> self fact-override)) trick-point-duration))
(when (>= (- (-> *display* game-clock frame-counter)
(-> (the-as fact-info-target (-> self fact-override)) trick-point-start-time)
)
(-> (the-as fact-info-target (-> self fact-override)) trick-point-duration)
)
(format
#t
"------------> ~,,f total points~%"
(-> (the-as fact-info-target (-> self fact-override)) trick-point)
)
(send-event
(handle->process (-> self notify))
'notify
'trick-judge
(-> (the-as fact-info-target (-> self fact-override)) trick-point)
)
(reset! (-> self fact-override) 'trick-judge)
)
)
(cond
((logtest? (-> self game features) (game-feature unk-game-feature-01))
(cond
((< (current-time) (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout))
(set-setting! 'bg-a 'abs 0.3 0)
(set-setting! 'bg-r 'abs 1.0 0)
(update-rates! (-> *display* entity-clock) 0.0)
(if (zero? (mod (the-as int (-> *display* base-clock integral-frame-counter)) 60))
(sound-play "stopwatch")
)
)
((nonzero? (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout))
(remove-setting! 'bg-a)
(remove-setting! 'bg-r)
(update-rates! (-> *display* entity-clock) 1.0)
(set! (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout) 0)
0
)
((cpad-pressed? (-> self control cpad number) r1)
(set! (-> (the-as fact-info-target (-> self fact-override)) stop-time-timeout) (+ (current-time) (seconds 5)))
)
)
)
((logtest? (-> self game features) (game-feature unk-game-feature-03))
(when *time-of-day-fast*
(set! *time-of-day-fast* #f)
(send-event (ppointer->process *time-of-day*) 'change 'ratio #x3f800000)
)
(cond
((cpad-hold? (-> self control cpad number) r1)
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 60.0 (* 120.0 (-> self clock seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 2.0 (* 120.0 (-> self clock seconds-per-frame)))
)
)
((or (!= (-> *display* entity-clock clock-ratio) 2.0) (!= (-> *display* target-clock clock-ratio) 1.0))
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 2.0 (* 120.0 (-> self clock seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 1.0 (* 120.0 (-> self clock seconds-per-frame)))
)
)
)
)
((logtest? (-> self game features) (game-feature unk-game-feature-05))
(when *time-of-day-fast*
(set! *time-of-day-fast* #f)
(send-event (ppointer->process *time-of-day*) 'change 'ratio #x3f800000)
)
(cond
((cpad-hold? (-> self control cpad number) r1)
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 0.3 (* 30.0 (-> self clock seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 0.5 (* 30.0 (-> self clock seconds-per-frame)))
)
)
((or (!= (-> *display* entity-clock clock-ratio) 1.0) (!= (-> *display* target-clock clock-ratio) 1.0))
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 1.0 (* 30.0 (-> self clock seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 1.0 (* 30.0 (-> self clock seconds-per-frame)))
)
)
)
)
)
(target-eco-process)
(target-color-effect-process)
(let ((a0-89 (-> self current-level)))
(case (if a0-89
(-> a0-89 info taskname)
)
(('sewer 'forest)
(let ((f30-2 (-> self board camera-interp)))
(cond
((focus-test? self board)
(seek! (-> self board camera-interp) 1.0 (* 0.1 (-> self clock seconds-per-frame)))
)
((< (-> self control ctrl-xz-vel) 2048.0)
)
(else
(seek! (-> self board camera-interp) 0.0 (* 0.1 (-> self clock seconds-per-frame)))
)
)
(let ((f28-0 (-> self board camera-interp)))
(when (!= f28-0 f30-2)
(cond
((= f28-0 0.0)
(remove-setting! 'fov)
(remove-setting! 'string-max-length)
(remove-setting! 'string-min-length)
)
(else
(set-setting! 'fov 'rel (lerp-scale 1.0 1.32 f28-0 0.0 1.0) 0)
(set-setting! 'string-min-length 'rel (lerp-scale 1.0 0.6 f28-0 0.0 1.0) 0)
(set-setting! 'string-max-length 'rel (lerp-scale 1.0 0.6 f28-0 0.0 1.0) 0)
)
)
)
)
)
)
)
)
(logclear! (-> self focus-status) (focus-status super))
(if (or (focus-test? self dead hit)
(logtest? (state-flags sf2 tinvul1 sf5 tinvul2) (-> self state-flags))
(-> *setting-control* user-current ignore-target)
)
(logior! (-> self focus-status) (focus-status ignore))
(logclear! (-> self focus-status) (focus-status ignore))
)
(cond
((or (and (logtest? (-> self control mod-surface flags) (surface-flag air))
(not (logtest? (-> self control status) (collide-status on-surface)))
)
(and (focus-test? self board) (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)))
)
(logior! (-> self focus-status) (focus-status in-air))
(if (logtest? (surface-flag super) (-> self control current-surface flags))
(set! (-> self focus-status) (logior (focus-status super) (-> self focus-status)))
)
)
(else
(logclear! (-> self focus-status) (focus-status in-air))
)
)
(if (using-gun? self)
(set! (-> self focus-status) (logior (focus-status gun) (-> self focus-status)))
(logclear! (-> self focus-status) (focus-status gun))
)
(if (or (logtest? (water-flags touch-water) (-> self water flags))
(logtest? (-> self control status) (collide-status on-water))
)
(logior! (-> self focus-status) (focus-status touch-water))
(logclear! (-> self focus-status) (focus-status touch-water))
)
(if (logtest? (-> self control status) (collide-status on-water))
(logior! (-> self focus-status) (focus-status on-water))
(logclear! (-> self focus-status) (focus-status on-water))
)
(if (and (logtest? (-> self water flags) (water-flags under-water))
(not (logtest? (-> self water flags) (water-flags swim-ground)))
)
(logior! (-> self focus-status) (focus-status under-water))
(logclear! (-> self focus-status) (focus-status under-water))
)
(if (= (-> self control ground-pat material) (pat-material ice))
(set! (-> self focus-status) (logior (focus-status ice) (-> self focus-status)))
(logclear! (-> self focus-status) (focus-status ice))
)
(if (< (- (current-time) (-> self gun fire-time)) (seconds 0.1))
(set! (-> self focus-status) (logior (focus-status shooting) (-> self focus-status)))
(logclear! (-> self focus-status) (focus-status shooting))
)
0
(none)
)
(defbehavior target-powerup-effect target ((arg0 symbol))
(case arg0
(('eco-blue)
(let ((v1-4 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(eco-blue-glow (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-4)))
)
)
)
0
(none)
)
(defbehavior process-contact-action target ((arg0 process))
(when (logtest? (-> *game-info* features) (game-feature unk-game-feature-01))
(if arg0
(set! (-> self clock) (-> arg0 clock))
(set! (-> self clock) (-> *display* base-clock))
)
)
0
(none)
)