Files
jak-project/goal_src/jak2/levels/city/shuttle/shuttle.gc
T
ManDude 7a8aa71204 [jak2] implement statistics tracker (#3288)
Currently only tracks enemy kills, and how they were killed. There is
currently no menu for this, but I've already added most of the text for
it. Also did a bunch of misc decompilation fixes and renamed some
methods.

Fixes #3277 
Fixes #3278
2024-01-11 22:49:41 +00:00

1731 lines
60 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: shuttle.gc
;; name in dgo: shuttle
;; dgos: LSHUTTLE
;; DECOMP BEGINS
(defmethod draw ((this hud-citizen))
(set-hud-piece-position!
(the-as hud-sprite (-> this sprites))
(the int (+ 452.0 (* 130.0 (-> this offset))))
195
)
(format (clear (-> this strings 0 text)) "~D" (-> this values 0 current))
(set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -15 47)
((method-of-type hud draw) this)
0
(none)
)
(defmethod update-values ((this hud-citizen))
(set! (-> this values 0 target) (the int (-> *game-info* counter)))
((method-of-type hud update-values) this)
0
(none)
)
(defmethod init-callback ((this hud-citizen))
(set! (-> this level) (level-get *level* 'ctywide))
(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 :index #x4 :page #x679)))
(set! (-> this sprites 0 flags) (the-as uint 4))
(set! (-> this sprites 0 scale-x) 0.9)
(set! (-> this sprites 0 scale-y) 0.9)
(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)
)
(defskelgroup skel-citizen-rebel citizen-rebel citizen-rebel-lod0-jg -1
((citizen-rebel-lod0-mg (meters 999999)))
:bounds (static-spherem 0 2 0 3)
:shadow citizen-rebel-shadow-mg
)
(define *citizen-rebel-global-info*
(new 'static 'civilian-global-info
:knocked (new 'static 'array int32 2 21 23)
:knocked-land (new 'static 'array int32 2 22 24)
:yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1
(new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 21 23))
)
:blue-hit-anim (new 'static 'inline-array civilian-anim-info 3
(new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 27))
(new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 27))
(new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 27 27))
)
:anim-cover-head-start 29
:anim-cover-head-loop 30
:anim-cover-head-end 31
:car-stance-anim 34
:bike-stance-anim 33
:get-in-car-anim 35
:seat-flag #x2
)
)
(define *citizen-rebel-nav-enemy-info*
(new 'static 'nav-enemy-info
:use-die-falling #t
:use-victory #f
:use-jump-blocked #f
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #t
:hover-if-no-ground #f
:idle-anim-script (new 'static 'array idle-control-frame 4
(new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x1)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
)
:idle-anim 3
:notice-anim 3
:hostile-anim -1
:hit-anim 3
:knocked-anim 21
:knocked-land-anim 22
:die-anim 3
:die-falling-anim 3
:victory-anim 3
:jump-wind-up-anim 11
:jump-in-air-anim 11
:jump-land-anim 11
:neck-joint 5
:look-at-joint 5
:bullseye-joint 4
:notice-distance (meters 10)
:notice-distance-delta (meters 0.1)
:default-hit-points 1
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:penetrate-knocked (penetrate
touch
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
vehicle
flut-attack
board
mech
mech-punch
mech-bonk
dark-skin
dark-punch
dark-bomb
dark-giant
shield
explode
jak-yellow-shot
jak-red-shot
jak-blue-shot
jak-dark-shot
enemy-yellow-shot
enemy-dark-shot
eco-yellow
eco-red
eco-blue
eco-green
knocked
penetrate-33
penetrate-34
penetrate-35
penetrate-36
penetrate-37
penetrate-38
penetrate-39
penetrate-40
penetrate-41
penetrate-42
penetrate-43
penetrate-44
penetrate-45
penetrate-46
penetrate-47
penetrate-48
penetrate-49
penetrate-50
penetrate-51
penetrate-52
penetrate-53
penetrate-54
penetrate-55
penetrate-56
penetrate-57
penetrate-58
penetrate-59
penetrate-60
penetrate-61
penetrate-62
penetrate-63
)
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 2730.6667
:knocked-soft-vxz-lo 32768.0
:knocked-soft-vxz-hi 49152.0
:knocked-soft-vy-lo 36864.0
:knocked-soft-vy-hi 73728.0
:knocked-medium-vxz-lo 81920.0
:knocked-medium-vxz-hi 143360.0
:knocked-medium-vy-lo 49152.0
:knocked-medium-vy-hi 102400.0
:knocked-hard-vxz-lo 102400.0
:knocked-hard-vxz-hi 122880.0
:knocked-hard-vy-lo 81920.0
:knocked-hard-vy-hi 102400.0
:knocked-huge-vxz-lo 164659.2
:knocked-huge-vxz-hi 249036.8
:knocked-huge-vy-lo 183500.8
:knocked-huge-vy-hi 217907.2
:knocked-yellow-vxz-lo 16384.0
:knocked-yellow-vxz-hi 32768.0
:knocked-yellow-vy-lo 24576.0
:knocked-yellow-vy-hi 49152.0
:knocked-red-vxz-lo 40960.0
:knocked-red-vxz-hi 61440.0
:knocked-red-vy-lo 36864.0
:knocked-red-vy-hi 73728.0
:knocked-blue-vxz-lo 32768.0
:knocked-blue-vxz-hi 65536.0
:knocked-blue-vy-lo 32768.0
:knocked-blue-vy-hi 49152.0
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint -1
:gem-offset (new 'static 'sphere :r 163840.0)
:callback-info #f
:use-momentum #t
:use-frustration #t
:use-stop-chase #f
:use-circling #f
:use-pacing #f
:walk-anim 11
:turn-anim 11
:run-anim 14
:taunt-anim -1
:run-travel-speed (meters 12)
:run-acceleration (meters 2)
:run-turning-acceleration (meters 30)
:walk-travel-speed (meters 3)
:walk-acceleration (meters 2)
:walk-turning-acceleration (meters 8)
:maximum-rotation-rate (degrees 720)
:notice-nav-radius (meters 10)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 20480.0
:circle-dist-hi 61440.0
:nav-mesh #f
)
)
(set! (-> *citizen-rebel-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(deftype citizen-rebel (citizen-norm)
((nav-mesh-aid actor-id)
(done? symbol)
(task-node uint16)
(end-pos vector :inline)
(index uint32)
(gui-id sound-id)
)
)
(defmethod cleanup-for-death ((this citizen-rebel))
(with-pp
(when (and (zero? (-> this hit-points)) (not (-> this done?)))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer pp))
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'fail)
(let ((t9-0 send-event-function)
(v1-9 (-> *game-info* sub-task-list (-> this task-node)))
)
(t9-0
(handle->process (if (-> v1-9 info)
(-> v1-9 info manager)
(the-as handle #f)
)
)
a1-0
)
)
)
)
((method-of-type citizen-norm cleanup-for-death) this)
(none)
)
)
(defstate get-up-front (citizen-rebel)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-front))
:num! (seek! max (-> self speed-scale))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max (-> self speed-scale)))
)
(if (-> self done?)
(go-virtual active)
(go-virtual wait-for-ride)
)
)
)
(defstate get-up-back (citizen-rebel)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-get-up-back))
:num! (seek! max (-> self speed-scale))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max (-> self speed-scale)))
)
(if (-> self done?)
(go-virtual active)
(go-virtual wait-for-ride)
)
)
)
(defstate knocked (citizen-rebel)
:virtual #t
:enter (behavior ()
(let ((gp-0 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000))))
(change-to gp-0 self)
(if (not (-> self nav))
(go-inactive self)
)
(set! (-> self nav-mesh-aid) (the-as actor-id (-> gp-0 entity aid)))
)
(let ((v1-10 (-> self nav state)))
(set! (-> v1-10 current-poly) (the-as nav-poly #f))
)
0
(do-navigation-to-destination (-> self nav state) (-> self root trans))
(set! (-> self gnd-height) (-> self root gspot-pos y))
(let ((s5-0 (new 'stack-no-clear 'vector))
(gp-1 (new 'stack-no-clear 'quaternion))
)
(vector-y-quaternion! s5-0 (-> self root quat))
(vector-normalize! s5-0 1.0)
(quaternion-from-two-vectors! gp-1 s5-0 *up-vector*)
(quaternion*! (-> self root quat) gp-1 (-> self root quat))
)
(let ((t9-8 (-> (method-of-type civilian knocked) enter)))
(if t9-8
(t9-8)
)
)
)
)
(defstate exit-vehicle (citizen-rebel)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((a0-1 (find-nearest-nav-mesh (-> self root trans) (the-as float #x7f800000))))
(if a0-1
(set! (-> self nav-mesh-aid) (the-as actor-id (-> a0-1 entity aid)))
)
(change-to a0-1 self)
)
(when (not (-> self nav))
(format #t "nav mesh not found~%")
(go-inactive self)
)
(let ((v1-11 (-> self nav state)))
(set! (-> v1-11 current-poly) (the-as nav-poly #f))
)
0
(citizen-method-195
self
(vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
)
(let ((a0-8 (-> self nav state))
(v1-17 (-> self controller turn-exit-point))
)
(logclear! (-> a0-8 flags) (nav-state-flag directional-mode))
(logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-8 target-post quad) (-> v1-17 quad))
)
0
(citizen-nav-init! self)
(set! (-> self gnd-height) (-> self root gspot-pos y))
(logior! (-> self flags) (citizen-flag persistent))
(logior! (-> self focus-status) (focus-status pilot-riding pilot))
(set-time! (-> self state-time))
(let ((v1-31 (-> self root root-prim)))
(set! (-> v1-31 prim-core collide-as) (collide-spec))
(set! (-> v1-31 prim-core collide-with) (collide-spec))
)
0
(let ((v1-33 self))
(set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-33 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(let ((v1-36 self))
(set! (-> v1-36 enemy-flags) (the-as enemy-flag (logclear (-> v1-36 enemy-flags) (enemy-flag enemy-flag37))))
)
0
)
:exit (behavior ()
(let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit)))
(if t9-0
(t9-0)
)
)
)
:code (behavior ()
(local-vars (sv-176 float) (sv-192 float) (sv-208 float))
(remove-rider (the-as vehicle (handle->process (-> self vehicle))) self)
(logclear! (-> self focus-status) (focus-status pilot-riding pilot))
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'quaternion))
)
(set-time! (-> self state-time))
(while (not (civilian-method-217 self gp-0))
(let ((s4-0 (handle->process (-> self vehicle)))
(s3-0 (new 'stack-no-clear 'quaternion))
)
(quaternion-copy! s3-0 (-> (the-as vehicle s4-0) root quat))
(compute-seat-position (the-as vehicle s4-0) (-> self root trans) (-> self seat))
(quaternion-copy! (-> self root quat) s3-0)
)
(when (time-elapsed? (-> self state-time) (seconds 2))
(put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self)
(go-virtual ride)
)
(suspend)
)
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim))
:num! (seek! (ja-aframe 5.0 0) 0.5)
:frame-num (ja-aframe 12.0 0)
)
(until (ja-done? 0)
(let ((s3-1 (handle->process (-> self vehicle)))
(s4-2 (new 'stack-no-clear 'quaternion))
)
(quaternion-copy! s4-2 (-> (the-as vehicle s3-1) root quat))
(compute-seat-position (the-as vehicle s3-1) (-> self root trans) (-> self seat))
(let ((s3-2 lerp-scale)
(s2-0 0.0)
(s1-0 1.0)
(s0-0 (ja-aframe-num 0))
)
(set! sv-176 (ja-aframe 10.0 0))
(let* ((t0-0 (ja-aframe 7.0 0))
(f0-4 (s3-2 s2-0 s1-0 s0-0 sv-176 t0-0))
)
(quaternion-rotate-local-y! (-> self root quat) s4-2 (* f0-4 (if (zero? (-> self seat))
-16384.0
16384.0
)
)
)
)
)
)
(suspend)
(ja :num! (seek! (ja-aframe 5.0 0) 0.5))
)
(let ((s4-4 (handle->process (-> self vehicle))))
(let ((s3-3 (new 'stack-no-clear 'quaternion)))
(quaternion-copy! s3-3 (-> (the-as vehicle s4-4) root quat))
(compute-seat-position (the-as vehicle s4-4) (-> self root trans) (-> self seat))
(quaternion-rotate-local-y! (-> self root quat) s3-3 (if (zero? (-> self seat))
-16384.0
16384.0
)
)
)
(remove-rider (the-as vehicle s4-4) self)
)
(logclear! (-> self focus-status) (focus-status pilot-riding pilot))
(let ((v1-65 (handle->process (-> self vehicle))))
(quaternion-copy! s5-0 (-> (the-as vehicle v1-65) root quat))
)
(ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim))
:num! (seek! (ja-aframe 1.0 0) 0.5)
:frame-num (ja-aframe 5.0 0)
)
(until (ja-done? 0)
(let ((a0-59 (handle->process (-> self vehicle)))
(s2-1 (new 'stack-no-clear 'vector))
(s4-6 (new 'stack-no-clear 'vector))
(s3-4 (new 'stack-no-clear 'quaternion))
)
(compute-seat-position (the-as vehicle a0-59) s2-1 (-> self seat))
(vector-! s4-6 s2-1 gp-0)
(let ((s2-2 lerp-scale)
(s1-1 0.0)
(s0-1 1.0)
)
(set! sv-192 (ja-aframe-num 0))
(set! sv-208 (ja-aframe 5.0 0))
(let* ((t0-1 (ja-aframe 1.0 0))
(f0-13 (s2-2 s1-1 s0-1 sv-192 sv-208 t0-1))
(f30-0 (- 1.0 f0-13))
)
(quaternion-rotate-local-y! s3-4 s5-0 (if (zero? (-> self seat))
-16384.0
16384.0
)
)
(let ((a1-39 (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-4))
(s2-3 (new 'stack-no-clear 'quaternion))
)
(quaternion-from-two-vectors! s2-3 a1-39 *up-vector*)
(quaternion*! s3-4 s2-3 s3-4)
)
(quaternion-copy! (-> self root quat) s3-4)
(vector+float*! (-> self root trans) gp-0 s4-6 f30-0)
)
)
)
(suspend)
(ja :num! (seek! (ja-aframe 1.0 0) 0.5))
)
)
(let ((v1-96 (-> self root root-prim)))
(set! (-> v1-96 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-96 prim-core collide-with) (-> self root backup-collide-with))
)
(go-virtual wait-for-ride)
)
)
(defstate wait-for-ride (citizen-rebel)
:virtual #t
:trans (behavior ()
(when (-> self vehicle)
(case (-> (the-as vehicle (handle->process (-> self vehicle))) info object-type)
((14 15 16)
(go-virtual move-to-vehicle)
)
)
)
(when (< (vector-vector-xz-distance (-> self root trans) (-> self end-pos)) 122880.0)
(when (not (-> self done?))
(set! (-> self done?) #t)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer self))
(set! (-> a1-4 num-params) 0)
(set! (-> a1-4 message) 'task-done)
(let ((t9-2 send-event-function)
(v1-22 (-> *game-info* sub-task-list (-> self task-node)))
)
(t9-2
(handle->process (if (-> v1-22 info)
(-> v1-22 info manager)
(the-as handle #f)
)
)
a1-4
)
)
)
)
(go-virtual active)
)
)
:code (behavior ()
(until #f
(let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0)))
(gp-0 (rand-vu-int-range 1 5))
(s5-0 (rand-vu-int-count 2))
)
(ja-channel-push! 1 (seconds 0.2))
(if (zero? s5-0)
(ja-no-eval :group! citizen-rebel-idle-to-arms-hips-ja :num! min)
(ja-no-eval :group! citizen-rebel-idle-to-arms-crossed-ja :num! min)
)
(let ((f28-0 0.0))
(while (< f28-0 1.0)
(ja :num-func num-func-identity
:frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0)
)
(suspend)
(+! f28-0 (seconds-per-frame))
)
)
(ja-channel-push! 1 (seconds 0.1))
(while (> gp-0 0)
(+! gp-0 -1)
(cond
((zero? s5-0)
(ja-no-eval :group! citizen-rebel-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-1))
)
)
(else
(ja-no-eval :group! citizen-rebel-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-1))
)
)
)
)
)
)
#f
)
)
(defstate in-ditch (citizen-rebel)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type civilian in-ditch) enter)))
(if t9-0
(t9-0)
)
)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'fail)
(let ((t9-1 send-event-function)
(v1-9 (-> *game-info* sub-task-list (-> self task-node)))
)
(t9-1
(handle->process (if (-> v1-9 info)
(-> v1-9 info manager)
(the-as handle #f)
)
)
a1-0
)
)
)
)
)
;; WARN: disable def twice: 51. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defmethod general-event-handler ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(case arg2
(('hit 'hit-flinch 'hit-knocked)
(when (nonzero? (-> this gui-id))
(set-action!
*gui-control*
(gui-action stop)
(-> this gui-id)
(gui-channel none)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(set! (-> this gui-id) (new 'static 'sound-id))
0
)
((method-of-type civilian general-event-handler) this arg0 arg1 arg2 arg3)
)
(('play-speech)
(let ((s5-1 (-> arg3 param 0)))
(when (= (get-status *gui-control* (-> this gui-id)) (gui-status unknown))
(let ((v0-1 (the-as
object
(add-process *gui-control* this (gui-channel citizen) (gui-action play) (the-as string s5-1) -99.0 0)
)
)
)
(set! (-> this gui-id) (the-as sound-id v0-1))
v0-1
)
)
)
)
(('nav-mesh-kill)
(format 0 "nav-mesh-kill event recieved by ~s~%" (-> this name))
(set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid)))
(change-to *default-nav-mesh* this)
#t
)
(else
((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(defmethod enemy-method-58 ((this citizen-rebel) (arg0 process) (arg1 event-message-block))
(let* ((t9-0 (method-of-type nav-enemy enemy-method-58))
(v0-0 (t9-0 this arg0 arg1))
)
(if (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using))
(set! v0-0 #f)
)
v0-0
)
)
(defmethod get-penetrate-info ((this citizen-rebel))
"@returns the allowed way(s) this enemy can take damage
@see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]"
(let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) this)))
(logior (penetrate enemy-yellow-shot) v1-1)
)
)
(defstate wait (citizen-rebel)
:virtual #t
:trans (behavior ()
'()
)
:code (behavior ()
(until #f
(let ((f30-1 (/ 1.0 (rand-vu-float-range 10.0 13.0)))
(gp-0 (rand-vu-int-range 1 5))
(s5-0 (rand-vu-int-count 2))
)
(ja-channel-push! 1 (seconds 0.2))
(if (zero? s5-0)
(ja-no-eval :group! citizen-rebel-idle-to-arms-hips-ja :num! min)
(ja-no-eval :group! citizen-rebel-idle-to-arms-crossed-ja :num! min)
)
(let ((f28-0 0.0))
(while (< f28-0 1.0)
(ja :num-func num-func-identity
:frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f28-0 f28-0 f28-0) (* 3.0 f28-0 f28-0)) 0.0 1.0)
)
(suspend)
(+! f28-0 (seconds-per-frame))
)
)
(ja-channel-push! 1 (seconds 0.1))
(while (> gp-0 0)
(+! gp-0 -1)
(cond
((zero? s5-0)
(ja-no-eval :group! citizen-rebel-arms-hips-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-1))
)
)
(else
(ja-no-eval :group! citizen-rebel-arms-crossed-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-1))
)
)
)
)
)
(if (-> self wait-return-state)
(go (-> self wait-return-state))
)
)
#f
)
)
(defmethod init-enemy! ((this citizen-rebel))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-rebel" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(init-enemy-behaviour-and-stats! this *citizen-rebel-nav-enemy-info*)
(let ((v1-5 (-> this nav)))
(set! (-> v1-5 speed-scale) 1.0)
)
0
(set! (-> this draw lod-set lod 0 dist) 491520.0)
(try-update-focus (-> this focus) *target* this)
(-> this neck)
(set! (-> this info) *citizen-rebel-global-info*)
(set! (-> this anim-shuffle) 10)
(let ((v1-16 (rnd-int-count this 3)))
(cond
((zero? v1-16)
(set! (-> this anim-walk) 11)
(set! (-> this dist-walk-anim) 8736.768)
(set! (-> this speed-walk) 10240.0)
)
((= v1-16 1)
(set! (-> this anim-walk) 12)
(set! (-> this dist-walk-anim) 13107.2)
(set! (-> this speed-walk) 12288.0)
)
((= v1-16 2)
(set! (-> this anim-walk) 13)
(set! (-> this dist-walk-anim) 4370.432)
(set! (-> this speed-walk) 4096.0)
)
)
)
(let ((v1-31 (rnd-int-count this 3)))
(cond
((zero? v1-31)
(set! (-> this anim-panic-run) 17)
)
((= v1-31 1)
(set! (-> this anim-panic-run) 18)
)
((= v1-31 2)
(set! (-> this anim-panic-run) 14)
)
)
)
(set! (-> this dist-run-anim) 28672.0)
(let ((v1-38 (rnd-int-count this 3)))
(cond
((zero? v1-38)
(set! (-> this anim-run) 14)
)
((= v1-38 1)
(set! (-> this anim-run) 15)
)
((= v1-38 2)
(set! (-> this anim-run) 16)
)
)
)
(set! (-> this speed-run) 49152.0)
(set! (-> this anim-on-ground) 20)
(set! (-> this anim-dive) 19)
(set! (-> this anim-get-up-front) 25)
(set! (-> this anim-get-up-back) 26)
(let ((f30-0 (rnd-float-range this 1.0 1.25))
(f0-10 (rnd-float-range this 1.0 1.25))
)
(set-vector! (-> this root scale) f0-10 f30-0 f0-10 1.0)
)
(let ((f0-12 (rnd-float-range this 0.9 1.0)))
(set-vector! (-> this draw color-mult) f0-12 f0-12 f0-12 1.0)
)
(set! (-> this water-anim) 32)
(set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0))
(set! (-> this water flags) (water-flags active part-splash part-rings part-water))
(set! (-> this water height) (res-lump-float (-> this entity) 'water-height))
(set! (-> this water ripple-size) 12288.0)
0
(none)
)
(defmethod init-enemy-collision! ((this citizen-rebel))
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrated-by) (penetrate
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
vehicle
flut-attack
board
mech-punch
dark-punch
dark-giant
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec civilian))
(set! (-> s4-0 prim-core collide-with)
(collide-spec backgnd jak civilian enemy hit-by-others-list player-list)
)
(set! (-> s4-0 prim-core action) (collide-action solid no-standon))
(set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec civilian))
(set! (-> v1-13 prim-core collide-with)
(collide-spec backgnd jak civilian enemy hit-by-others-list player-list)
)
(set! (-> v1-13 prim-core action) (collide-action solid))
(set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 4096.0)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec civilian))
(set! (-> v1-15 prim-core collide-with)
(collide-spec backgnd jak civilian enemy hit-by-others-list player-list)
)
(set! (-> v1-15 prim-core action) (collide-action solid no-standon))
(set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4096.0)
)
(set! (-> s5-0 nav-radius) 7372.8)
(let ((v1-17 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod citizen-init! ((this citizen-rebel))
"Initialize [[citizen]] defaults."
(let ((t9-0 (method-of-type civilian citizen-init!)))
(t9-0 this)
)
(set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu))))
(logclear! (-> this mask) (process-mask enemy))
(setup-masks (-> this draw) 0 -1)
(setup-masks (-> this draw) 4 0)
(setup-masks (-> this draw) 16 0)
(setup-masks (-> this draw) 64 0)
(let ((v1-14 (rnd-int-count this 3)))
(cond
((zero? v1-14)
(setup-masks (-> this draw) 2 0)
)
((= v1-14 1)
(setup-masks (-> this draw) 8 0)
)
((= v1-14 2)
(setup-masks (-> this draw) 128 0)
)
)
)
(let ((v1-23 (rnd-int-count this 2)))
(cond
((zero? v1-23)
(setup-masks (-> this draw) 32 0)
)
((= v1-23 1)
(setup-masks (-> this draw) 256 0)
)
)
)
(let ((v1-29 (-> this nav)))
(set! (-> v1-29 sphere-mask) (the-as uint #x800fe))
)
0
0
(none)
)
(deftype city-shuttle-info (structure)
((pos vector :inline)
(level symbol)
(nav-mesh-id uint32)
(time time-frame)
)
)
;; WARN: Return type mismatch float vs none.
(defun shuttle-init ((arg0 task-manager) (arg1 (array city-shuttle-info)))
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
(let ((s3-0 *traffic-manager*)
(s4-0 (new 'stack 'traffic-object-spawn-params))
)
(set! (-> s4-0 position quad) (-> arg0 begin-pos quad))
(quaternion-axis-angle! (-> s4-0 rotation) 0.0 1.0 0.0 0.0)
(set! (-> s4-0 object-type) (traffic-type cara))
(set! (-> s4-0 behavior) (the-as uint 0))
(set! (-> s4-0 id) (the-as uint 0))
(set! (-> s4-0 proc) #f)
(send-event s3-0 'spawn-object s4-0)
(if (not (-> s4-0 proc))
(format #t "traffic object spawn failed~%")
)
(if (-> s4-0 proc)
(set! (-> arg0 slave 12) (process->handle (-> s4-0 proc)))
)
)
(let ((s4-1 (new 'stack-no-clear 'task-arrow-params)))
(set! (-> s4-1 pos quad) (-> arg1 0 pos quad))
(quaternion-identity! (-> s4-1 quat))
(set! (-> s4-1 flags) (task-arrow-flags))
(set! (-> s4-1 map-icon) (the-as uint 15))
(set! (-> arg0 arrow) (process->handle (task-arrow-spawn s4-1 arg0)))
)
(set-parking-spot-prob *traffic-engine* 11 0.08)
(set-parking-spot-prob *traffic-engine* 12 0.08)
(set-parking-spot-prob *traffic-engine* 13 0.08)
(set-parking-spot-prob *traffic-engine* 14 0.35)
(set-parking-spot-prob *traffic-engine* 15 0.35)
(set-parking-spot-prob *traffic-engine* 16 0.08)
(set! (-> arg0 start-time) 0)
(set! (-> arg0 sub-state) (the-as uint 0))
(set! (-> arg0 count) (-> arg1 length))
(dotimes (v1-35 (-> arg0 count))
(set! (-> arg0 data-int32 v1-35) 0)
)
(set! (-> arg0 data-int32 8) 0)
(set! (-> arg0 data-int32 9) 0)
(set! (-> arg0 data-int32 10) 0)
(set! (-> *game-info* counter) (the float (/ (-> arg0 count) 2)))
(none)
)
;; WARN: Return type mismatch symbol vs none.
(defun shuttle-cleanup ((arg0 task-manager) (arg1 (array city-shuttle-info)))
(send-event *traffic-manager* 'restore-default-settings)
(dotimes (s5-0 (-> arg0 count))
(let ((a0-4 (handle->process (-> arg0 slave s5-0))))
(if a0-4
(deactivate a0-4)
)
)
)
(none)
)
;; WARN: Return type mismatch object vs none.
(defun shuttle-update ((arg0 task-manager) (arg1 (array city-shuttle-info)) (arg2 uint))
(local-vars (v1-263 float) (v1-377 float) (sv-336 quaternion))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(cond
((nonzero? (-> arg0 data-int32 9))
(check-time arg0)
)
(else
(set-time! (-> arg0 start-time))
(when (< (vector-vector-xz-distance (target-pos 0) (-> arg0 begin-pos)) 102400.0)
(set-setting! 'airlock #f 0.0 0)
(set! (-> arg0 data-int32 9) 1)
)
)
)
(when (= (-> arg0 data-int32 10) (+ (-> arg0 sub-state) -1))
(let ((s3-1 (handle->process (-> arg0 slave (logand -2 (-> arg0 data-int32 10))))))
(when s3-1
(let ((v1-20 (-> arg0 data-int32 10)))
(cond
((zero? v1-20)
(let ((v0-4 (rand-vu-int-count 3)))
(cond
((zero? v0-4)
(send-event s3-1 'play-speech "agnt038")
)
((= v0-4 1)
(send-event s3-1 'play-speech "agnt039")
)
((= v0-4 2)
(send-event s3-1 'play-speech "agnt040")
)
)
)
)
((= v1-20 1)
(let ((v0-8 (rand-vu-int-count 4)))
(cond
((zero? v0-8)
(send-event s3-1 'play-speech "agnt045")
)
((= v0-8 1)
(send-event s3-1 'play-speech "agnt046")
)
((= v0-8 2)
(send-event s3-1 'play-speech "agnt047")
)
((= v0-8 3)
(send-event s3-1 'play-speech "agnt048")
)
)
)
)
((= v1-20 2)
(let ((v0-13 (rand-vu-int-count 4)))
(cond
((zero? v0-13)
(send-event s3-1 'play-speech "agnt092")
)
((= v0-13 1)
(send-event s3-1 'play-speech "agnt093")
)
((= v0-13 2)
(send-event s3-1 'play-speech "agnt094")
)
((= v0-13 3)
(send-event s3-1 'play-speech "agnt095")
)
)
)
)
((= v1-20 3)
(let ((v0-18 (rand-vu-int-count 3)))
(cond
((zero? v0-18)
(send-event s3-1 'play-speech "agnt100")
)
((= v0-18 1)
(send-event s3-1 'play-speech "agnt101")
)
((= v0-18 2)
(send-event s3-1 'play-speech "agnt102")
)
)
)
)
((= v1-20 4)
(let ((v0-22 (rand-vu-int-count 3)))
(cond
((zero? v0-22)
(send-event s3-1 'play-speech "agnt115")
)
((= v0-22 1)
(send-event s3-1 'play-speech "agnt121")
)
((= v0-22 2)
(send-event s3-1 'play-speech "agnt122")
)
)
)
)
((= v1-20 5)
(let ((v0-26 (rand-vu-int-count 3)))
(cond
((zero? v0-26)
(send-event s3-1 'play-speech "agnt119")
)
((= v0-26 1)
(send-event s3-1 'play-speech "agnt120")
)
((= v0-26 2)
(send-event s3-1 'play-speech "agnt125")
)
)
)
)
((= v1-20 6)
(let ((v0-30 (rand-vu-int-count 5)))
(cond
((zero? v0-30)
(send-event s3-1 'play-speech "agnt131")
)
((= v0-30 1)
(send-event s3-1 'play-speech "agnt132")
)
((= v0-30 2)
(send-event s3-1 'play-speech "agnt133")
)
((= v0-30 3)
(send-event s3-1 'play-speech "agnt126")
)
((= v0-30 4)
(send-event s3-1 'play-speech "agnt127")
)
)
)
)
((= v1-20 7)
(let ((v0-36 (rand-vu-int-count 2)))
(cond
((zero? v0-36)
(send-event s3-1 'play-speech "agnt135")
)
((= v0-36 1)
(send-event s3-1 'play-speech "agnt130")
)
)
)
)
)
)
(+! (-> arg0 data-int32 10) 1)
)
)
)
(let ((s3-2 (-> arg0 sub-state)))
(cond
((>= s3-2 (the-as uint (-> arg0 count)))
(go (method-of-object arg0 complete))
)
((not (logtest? s3-2 1))
(let ((s2-0 (handle->process (-> arg0 slave s3-2))))
(cond
(s2-0
(let* ((s1-0 (entity-nav-mesh-by-aid (-> (the-as citizen-rebel s2-0) nav-mesh-aid)))
(s4-1 (if (type? s1-0 entity-nav-mesh)
s1-0
)
)
)
(cond
(s4-1
(when (focus-test? (the-as citizen-rebel s2-0) inactive)
(let ((s1-1 (new 'stack 'traffic-object-spawn-params)))
(set! (-> s1-1 object-type) (traffic-type tt5))
(set! (-> s1-1 behavior) (the-as uint 7))
(set! (-> s1-1 id) (the-as uint 0))
(set! (-> s1-1 nav-mesh) #f)
(set! (-> s1-1 nav-branch) #f)
(set! (-> s1-1 proc) #f)
(set! (-> s1-1 handle) (-> arg0 slave s3-2))
(set! (-> s1-1 user-data) (the-as uint 0))
(set! (-> s1-1 flags) (traffic-spawn-flags))
(set! (-> s1-1 guard-type) (the-as uint 7))
(vector-reset! (-> s1-1 velocity))
(set! (-> s1-1 position quad) (-> (the-as citizen-rebel s2-0) root trans quad))
(quaternion-copy! (-> s1-1 rotation) (-> (the-as citizen-rebel s2-0) root quat))
(set! (-> s1-1 nav-mesh) (-> s4-1 nav-mesh))
(activate-by-handle *traffic-engine* s1-1)
)
)
(let ((v1-230 *target*))
(when (and v1-230 (focus-test? v1-230 pilot))
(let ((s4-2 (handle->process (-> v1-230 pilot vehicle))))
(when s4-2
(cond
((and (focus-test? (the-as citizen-rebel s2-0) pilot)
(handle->process (-> (the-as citizen-rebel s2-0) vehicle))
)
(send-event (handle->process (-> arg0 arrow)) 'set-position (-> arg1 (+ s3-2 1) pos))
(+! (-> arg0 sub-state) 1)
(set! (-> arg0 time-limit) (+ (-> arg1 s3-2 time) (-> arg1 (+ s3-2 1) time)))
)
(else
(let ((v1-260 (get-best-seat-for-vehicle
(the-as vehicle s4-2)
(-> (the-as vehicle s4-2) root trans)
(the-as int (-> (the-as citizen-rebel s2-0) info seat-flag))
1
)
)
)
(when (!= v1-260 -1)
(.lvf vf1 (&-> (-> (the-as vehicle s4-2) root transv) quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-263 vf1)
(let ((f0-1 v1-263)
(f1-1 32768.0)
)
(if (and (< f0-1 (* f1-1 f1-1)) (let ((f0-2 (vector-vector-distance-squared
(-> (the-as vehicle s4-2) root trans)
(-> (the-as citizen-rebel s2-0) root trans)
)
)
(f1-4 65536.0)
)
(< f0-2 (* f1-4 f1-4))
)
)
(send-event s2-0 'board-vehicle s4-2)
)
)
)
)
)
)
)
)
)
)
)
(else
(if (not (focus-test? (the-as citizen-rebel s2-0) inactive))
(send-event s2-0 'traffic-off-force)
)
)
)
)
(if (and (-> s2-0 next-state) (= (-> s2-0 next-state name) 'wait-for-ride))
(send-event (handle->process (-> arg0 arrow)) 'set-position (-> (the-as citizen-rebel s2-0) root trans))
)
)
(else
(when (zero? (-> arg0 data-int32 s3-2))
(send-event (handle->process (-> arg0 arrow)) 'set-position (-> arg1 s3-2 pos))
(set! (-> arg0 time-limit) (-> arg1 s3-2 time))
(set-time! (-> arg0 start-time))
(set! (-> arg0 data-int32 s3-2) 1)
)
(let ((s1-2 (find-nearest-nav-mesh (-> arg1 s3-2 pos) (the-as float #x7f800000))))
(when (and s1-2 (nonzero? s1-2))
(let ((s2-1 (new 'stack 'traffic-object-spawn-params)))
(set! (-> s2-1 object-type) (traffic-type tt5))
(set! (-> s2-1 behavior) (the-as uint 7))
(set! (-> s2-1 id) (the-as uint 0))
(set! (-> s2-1 nav-mesh) #f)
(set! (-> s2-1 nav-branch) #f)
(set! (-> s2-1 proc) #f)
(set! (-> s2-1 handle) (the-as handle #f))
(set! (-> s2-1 user-data) (the-as uint 0))
(set! (-> s2-1 flags) (traffic-spawn-flags))
(set! (-> s2-1 guard-type) (the-as uint 7))
(vector-reset! (-> s2-1 velocity))
(set! (-> s2-1 position quad) (-> arg1 s3-2 pos quad))
(let ((s0-0 quaternion-copy!))
(set! sv-336 (-> s2-1 rotation))
(let ((a1-50 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *up-vector* 0.0)))
(s0-0 sv-336 a1-50)
)
)
(logior! (-> s2-1 flags) (traffic-spawn-flags trsflags-00))
(set! (-> s2-1 id) (the-as uint 122))
(set! (-> s2-1 proc) #f)
(let ((v0-58 (citizen-spawn arg0 citizen-rebel s2-1)))
(cond
(v0-58
(set! (-> (the-as citizen-rebel v0-58) end-pos quad) (-> arg1 (+ s3-2 1) pos quad))
(set! (-> arg0 slave s3-2) (process->handle (the-as citizen-rebel v0-58)))
(logior! (-> (the-as citizen-rebel v0-58) flags) (citizen-flag persistent))
(set! (-> (the-as citizen-rebel v0-58) task-node) arg2)
(set! (-> (the-as citizen-rebel v0-58) nav-mesh-aid) (the-as actor-id (-> s1-2 entity aid)))
(set! (-> (the-as citizen-rebel v0-58) done?) #f)
(set! (-> (the-as citizen-rebel v0-58) index) s3-2)
(send-event *traffic-manager* 'add-object (-> s2-1 object-type) (the-as citizen-rebel v0-58))
)
(else
)
)
)
)
)
)
)
)
)
)
(else
(let ((s4-3 (handle->process (-> arg0 slave (+ s3-2 -1)))))
(if (not s4-3)
(go (method-of-object arg0 fail))
)
(if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status))))
(send-event s4-3 'exit-vehicle (-> (the-as process-drawable s4-3) root trans))
)
(when (-> *target* pilot)
(let ((s5-1 (-> arg1 s3-2 pos))
(s2-2 (handle->process (-> *target* pilot vehicle)))
)
(cond
((focus-test? (the-as process-focusable s4-3) pilot)
(if (and s2-2
(let ((f0-3 (vector-vector-distance-squared s5-1 (-> (the-as process-drawable s2-2) root trans)))
(f1-7 65536.0)
)
(< f0-3 (* f1-7 f1-7))
)
(begin
(.lvf vf1 (&-> (-> (the-as process-drawable s2-2) root transv) quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-377 vf1)
(let ((f0-4 v1-377)
(f1-10 12288.0)
)
(< f0-4 (* f1-10 f1-10))
)
)
)
(send-event s4-3 'exit-vehicle s5-1)
)
)
((not (-> (the-as citizen-rebel s4-3) done?))
(set! (-> arg0 data-int32 s3-2) 0)
(+! (-> arg0 sub-state) -1)
)
)
)
)
)
)
)
)
(none)
)
)
(define *city-shuttle-info* (new 'static 'boxed-array :type city-shuttle-info
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 4288512.0 :y 37969.92 :z 237568.0 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 4419584.0 :y 33341.44 :z 1449984.0 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 3519856.8 :y 33341.44 :z 1196646.4 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 2766438.5 :y 32727.04 :z -1390428.1 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 1641594.9 :y 32727.04 :z -1032192.0 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 1734901.8 :y 32563.2 :z -239656.95 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 2341396.5 :y 32727.04 :z -63037.44 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 2429870.0 :y 32563.2 :z -2287288.2 :w 1.0)
:level 'ctyslumc
:nav-mesh-id #x2644
:time (seconds 60)
)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_EVENT_HOOK
(lambda :behavior task-manager
((arg0 citizen-rebel) (arg1 object) (arg2 symbol))
(case arg2
(('task-done)
(format #t "task-done~%")
(set! (-> self sub-state) (+ (-> arg0 index) 2))
(+! (-> *game-info* counter) -1.0)
)
)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_INIT_HOOK
(lambda :behavior task-manager
()
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
(set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad))
(let ((v1-4 (entity-by-name "parking-spot-8")))
(if v1-4
(logior! (-> v1-4 extra perm status) (entity-perm-status bit-9))
)
)
(shuttle-init self *city-shuttle-info*)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_CLEANUP_HOOK
(lambda :behavior task-manager
()
(shuttle-cleanup self *city-shuttle-info*)
(send-event *traffic-manager* 'restore-default-settings)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_UPDATE_HOOK
(lambda :behavior task-manager () (shuttle-update self *city-shuttle-info* (the-as uint 95)) (none))
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_CODE_HOOK
(lambda :behavior task-manager
()
(set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self)))
(send-event *traffic-manager* 'set-target-level 0.75)
(send-event *traffic-manager* 'set-guard-target-count-range 4 0 1)
(send-event *traffic-manager* 'set-guard-target-count-range 5 0 1)
(send-event *traffic-manager* 'set-guard-target-count-range 0 0 2)
(send-event *traffic-manager* 'set-guard-target-count-range 1 0 3)
(while (zero? (-> self sub-state))
(suspend)
)
(set-time! (-> self state-time))
(while (not (time-elapsed? (-> self state-time) (seconds 5)))
(suspend)
)
(send-event *traffic-manager* 'set-alert-level 2)
(send-event *traffic-manager* 'set-alert-duration (seconds 36000))
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_FAIL_HOOK
(lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none))
)
(set-subtask-hook!
*game-info*
(game-task-node city-shuttle-shuttle)
TASK_MANAGER_COMPLETE_HOOK
(lambda :behavior task-manager
()
(set-time! (-> self state-time))
(talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f))
(let ((gp-1 (current-time)))
(until #f
(let ((v1-4 0))
(dotimes (a0-2 4)
(let ((a1-5 (handle->process (-> self slave (* a0-2 2)))))
(if (or (not a1-5) (and (-> a1-5 next-state) (= (-> a1-5 next-state name) 'inactive)))
(+! v1-4 1)
)
)
)
(if (or (>= v1-4 4) (time-elapsed? gp-1 (seconds 10)))
(goto cfg-23)
)
)
(suspend)
0
)
)
#f
(label cfg-23)
(task-node-close! (game-task-node city-shuttle-resolution))
(none)
)
)
(define *city-burning-bush-shuttle-1-info*
(new 'static 'boxed-array :type city-shuttle-info
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x -1519902.8 :y 32727.04 :z 2502369.2 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 715612.2 :y 81879.04 :z 2993889.2 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 1588920.4 :y 65536.0 :z 2774384.8 :w 1.0)
:level 'ctysluma
:nav-mesh-id #x2578
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x -218152.95 :y 31621.12 :z 5460336.5 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 767180.8 :y 70778.88 :z 7193682.0 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 4055408.8 :y 32727.04 :z 4727562.0 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 4694958.0 :y 32727.04 :z 3358392.2 :w 1.0)
:level 'ctyslumb
:nav-mesh-id #x2644
:time (seconds 60)
)
(new 'static 'city-shuttle-info
:pos (new 'static 'vector :x 4653957.0 :y 33341.44 :z 638730.25 :w 1.0)
:level 'ctyslumc
:nav-mesh-id #x2644
:time (seconds 60)
)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_EVENT_HOOK
(lambda :behavior task-manager
((arg0 citizen-rebel) (arg1 object) (arg2 symbol))
(case arg2
(('task-done)
(format #t "task-done~%")
(set! (-> self sub-state) (+ (-> arg0 index) 2))
(+! (-> *game-info* counter) -1.0)
)
)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_INIT_HOOK
(lambda :behavior task-manager
()
(set-setting! 'airlock #f 0.0 0)
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
(set! (-> self begin-pos quad) (-> (new 'static 'vector :x -687390.75 :y 40960.0 :z 3479224.2 :w 1.0) quad))
(shuttle-init self *city-burning-bush-shuttle-1-info*)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_CLEANUP_HOOK
(lambda :behavior task-manager
()
(shuttle-cleanup self *city-burning-bush-shuttle-1-info*)
(send-event *traffic-manager* 'restore-default-settings)
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_UPDATE_HOOK
(lambda :behavior task-manager
()
(the-as symbol (shuttle-update self *city-burning-bush-shuttle-1-info* (the-as uint 279)))
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_CODE_HOOK
(lambda :behavior task-manager
()
(set! (-> self hud-counter) (ppointer->handle (process-spawn hud-citizen :init hud-init-by-other :to self)))
(send-event *traffic-manager* 'set-target-level 0.75)
(send-event *traffic-manager* 'set-guard-target-count-range 4 0 1)
(send-event *traffic-manager* 'set-guard-target-count-range 5 0 1)
(send-event *traffic-manager* 'set-guard-target-count-range 0 0 2)
(send-event *traffic-manager* 'set-guard-target-count-range 1 0 3)
(while (zero? (-> self sub-state))
(suspend)
)
(set-time! (-> self state-time))
(while (not (time-elapsed? (-> self state-time) (seconds 5)))
(suspend)
)
(send-event *traffic-manager* 'set-alert-level 2)
(send-event *traffic-manager* 'set-alert-duration (seconds 36000))
(none)
)
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_FAIL_HOOK
(lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'die) (none))
)
(set-subtask-hook!
*game-info*
(game-task-node city-burning-bush-shuttle-1-resolution)
TASK_MANAGER_COMPLETE_HOOK
(lambda :behavior task-manager
()
(set-time! (-> self state-time))
(until #f
(let ((v1-2 0))
(dotimes (a0-0 4)
(let ((a1-4 (handle->process (-> self slave (* a0-0 2)))))
(if (and a1-4 (-> a1-4 next-state) (= (-> a1-4 next-state name) 'inactive))
(+! v1-2 1)
)
)
)
(if (= v1-2 4)
(goto cfg-20)
)
)
(suspend)
0
)
#f
(label cfg-20)
;; og:preserve-this
;; unnecessary - the task manager can take care of this
(task-node-close! (game-task-node city-burning-bush-shuttle-1-resolution))
(none)
)
)