mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
e2e5289788
- `pecker-ingame` - `des-bbush-tasks` - `des-burning-bush` - `des-bush-part` - `des-bush` - `mh-centipede` - `mh-centipede-part` - `mh-wasp` - `mh-wasp-part` - `needle-fish` - `des-bush-time-chase` - `timer-path` - `mission-squad-control-h` - `mh-bat` - `hover-nav-factoryd` - `hover-nav-factoryc` - `conveyor` - `fac-part` - `factory-part` - `factoryc-mood` - `factoryc-obs` - `factoryc-obs2` - `lfaccar-init` - `factory-boss-part` - `factory-boss-scenes` - `factory-boss-setup` - `factory-boss-states` - `factory-mood` - `factoryc-manager` - `lfacrm1-mood` - `lfacrm2-mood` - `missile-bot` - `sew-laser-turret` - `ai-task-h` - `ash-h` - `ash-shot` - `ash-states` - `ash-task` - `ash` - `bot-h` - `bot-states` - `bot` - `ash-oasis-course` - `oasis-defense` - `comb-field` - `comb-mood` - `comb-obs` - `comb-part` - `comb-scenes` - `comb-sentry` - `comb-travel` - `comba-init` - `combx-scenes` - `h-sled` - `destroy-dark-eco` - `fac-gunturret` - `fac-robotank-turret` - `fac-robotank` - `fac-tower` - `factory-h` - `factory-hud` - `factory-manager` - `factorya-init` - `ffight-projectile` - `ftank-projectile` - `fturret-projectile` - `h-warf` - `warf-projectile`
212 lines
6.8 KiB
Common Lisp
212 lines
6.8 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: lfacrm2-mood.gc
|
|
;; name in dgo: lfacrm2-mood
|
|
;; dgos: LFACRM2
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype fac-elevator-a (elevator)
|
|
((mysound sound-id)
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-fac-elevator-a fac-elevator-a fac-elevator-a-lod0-jg fac-elevator-a-idle-ja
|
|
((fac-elevator-a-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 11)
|
|
)
|
|
|
|
(defstate running (fac-elevator-a)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(set! (-> self mysound) (sound-play "elevator-a"))
|
|
(let ((t9-3 (-> (find-parent-state) enter)))
|
|
(if t9-3
|
|
(t9-3)
|
|
)
|
|
)
|
|
)
|
|
:exit (behavior ()
|
|
(sound-stop (-> self mysound))
|
|
(set! (-> self mysound) (sound-play "elevator-hit"))
|
|
(let ((t9-4 (-> (find-parent-state) exit)))
|
|
(if t9-4
|
|
(t9-4)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(when *sound-player-enable*
|
|
(let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
|
|
(set! (-> gp-0 command) (sound-command set-param))
|
|
(set! (-> gp-0 id) (-> self mysound))
|
|
(let ((a1-0 (target-pos 0)))
|
|
(let ((s5-0 self))
|
|
(when (= a1-0 #t)
|
|
(if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root)))
|
|
(set! a1-0 (-> s5-0 root trans))
|
|
(set! a1-0 (the-as vector #f))
|
|
)
|
|
)
|
|
)
|
|
(sound-trans-convert (-> gp-0 params trans) a1-0)
|
|
)
|
|
(set! (-> gp-0 params mask) (the-as uint 32))
|
|
(-> gp-0 id)
|
|
)
|
|
)
|
|
(let ((t9-5 (-> (find-parent-state) trans)))
|
|
(if t9-5
|
|
(t9-5)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(when (not (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0)))
|
|
(ja-no-eval :group! fac-elevator-a-gate_up-ja :num! (seek! max 1.333) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max 1.333))
|
|
)
|
|
)
|
|
(let ((t9-5 (-> (find-parent-state) code)))
|
|
(if t9-5
|
|
((the-as (function none) t9-5))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defstate arrived (fac-elevator-a)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(go-virtual dormant)
|
|
)
|
|
)
|
|
|
|
(defstate waiting (fac-elevator-a)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(format #t "~I~%" (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))
|
|
(if (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))
|
|
(ja :group! fac-elevator-a-gate_up-ja :num! max)
|
|
(ja :group! fac-elevator-a-gate_up-ja :num! min)
|
|
)
|
|
(sleep-code)
|
|
)
|
|
)
|
|
|
|
(defstate dormant (fac-elevator-a)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(let ((gp-0 (current-time)))
|
|
(until (time-elapsed? gp-0 (seconds 1.5))
|
|
'()
|
|
(suspend)
|
|
)
|
|
)
|
|
(ja-no-eval :group! fac-elevator-a-gate_down-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(sleep-code)
|
|
)
|
|
)
|
|
|
|
(defmethod get-art-group ((this fac-elevator-a))
|
|
(art-group-get-by-name *level* "skel-fac-elevator-a" (the-as (pointer level) #f))
|
|
)
|
|
|
|
;; WARN: Return type mismatch collide-shape-moving vs none.
|
|
(defmethod init-collision! ((this fac-elevator-a))
|
|
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
|
|
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
|
(set! (-> s5-0 reaction) cshape-reaction-default)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0)))
|
|
(set! (-> s5-0 total-prims) (the-as uint 4))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
|
|
(set! (-> s4-0 transform-index) 3)
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(pusher-init s5-0)
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-15 prim-core collide-as) (collide-spec pusher))
|
|
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-15 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-15 transform-index) 3)
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0)
|
|
)
|
|
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher))
|
|
(set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-17 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-17 transform-index) 4)
|
|
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 45056.0)
|
|
)
|
|
(let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint (shl #xfe00 16)))))
|
|
(set! (-> v1-20 prim-core action) (collide-action solid))
|
|
(set! (-> v1-20 transform-index) 3)
|
|
(set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 45056.0)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-23 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; WARN: Return type mismatch sound-spec vs none.
|
|
(defmethod base-plat-method-34 ((this fac-elevator-a))
|
|
(set! (-> this bounce-scale) 0.0)
|
|
(set! (-> this sound-running-loop) (static-sound-spec "fac-elevator-a" :group 0))
|
|
(none)
|
|
)
|
|
|
|
(deftype lfacrm2-states (structure)
|
|
()
|
|
)
|
|
|
|
|
|
(defbehavior update-mood-lfacrm2 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
|
|
(update-mood-interior arg0 #f)
|
|
(cond
|
|
((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode)))
|
|
(palette-select-special arg0)
|
|
)
|
|
(else
|
|
(-> arg0 state)
|
|
(set! (-> arg0 times 0 w) 1.0)
|
|
(set! (-> arg0 times 1 w) 1.0)
|
|
(let* ((a0-5 (-> *display* part-clock frame-counter))
|
|
(v1-8 (mod a0-5 300))
|
|
(s5-0 (mod a0-5 900))
|
|
)
|
|
(set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-8))))))
|
|
(set! (-> arg0 times 3 w) (if (< 450 s5-0)
|
|
1.0
|
|
0.5
|
|
)
|
|
)
|
|
)
|
|
(set! (-> arg0 times 4 w) 1.0)
|
|
(set! (-> arg0 times 5 w) 1.0)
|
|
(set! (-> arg0 times 6 w) 1.0)
|
|
(set! (-> arg0 times 7 w) 1.0)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|