From 7a2575fd233d56e116f7105eef588450c5ee7363 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sat, 18 Feb 2023 16:30:29 +0100 Subject: [PATCH] decomp: `meet-brutter` (#2218) --- decompiler/config/jak2/all-types.gc | 169 +- .../jak2/anonymous_function_types.jsonc | 16 + decompiler/config/jak2/hacks.jsonc | 4 +- decompiler/config/jak2/label_types.jsonc | 17 + decompiler/config/jak2/stack_structures.jsonc | 14 +- decompiler/config/jak2/type_casts.jsonc | 93 +- goal_src/jak2/engine/ai/traffic-h.gc | 2 + .../jak2/levels/city/common/ctywide-obs.gc | 275 ++ .../market/west/brutter_kiosk/meet-brutter.gc | 3337 ++++++++++++++++ .../west/brutter_kiosk/meet-brutter_REF.gc | 3508 +++++++++++++++++ test/offline/config/jak2/config.jsonc | 1 + 11 files changed, 7356 insertions(+), 80 deletions(-) create mode 100644 test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index ab9ae361f0..8b4deb137d 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -9035,6 +9035,7 @@ (citizen-fat 2) (citizen-norm-2 3) (crimson-guard-0 4) + (tt5 5) (crimson-guard-1 6) (crimson-guard-2 7) (metalhead-grunt 8) @@ -9046,6 +9047,7 @@ (cara 14) (carb 15) (carc 16) + (tt17 17) (guard-bike 18) (hellcat 19) (traffic-type-20 20) @@ -34933,82 +34935,6 @@ ) ) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; meet-brutter ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -#| -(deftype paddywagon (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype pw-iter-seg (UNKNOWN) - ((self basic :offset-assert 0) - (desired-dir vector :inline :offset-assert 16) - (score float :offset-assert 32) - (seg nav-segment :offset-assert 36) - (level basic :offset-assert 40) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - -#| -(deftype city-lurker (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype city-meet-brutter-info (UNKNOWN) - ((pos vector :inline :offset-assert 0) - (level basic :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - -#| -(deftype city-save-lurkers-info (UNKNOWN) - ((pos vector :inline :offset-assert 0) - (level basic :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) - (pipe-name basic :offset-assert 48) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - -;; (define-extern *paddywagon-constants* object) -;; (define-extern pw-iter-seg-new-dir-level function) -;; (define-extern choose-next-branch-no-exit-level function) -;; (define-extern *city-lurker-global-info* civilian-global-info) -;; (define-extern *city-lurker-nav-enemy-info* nav-enemy-info) -;; (define-extern *city-meet-brutter-vehicle-info* object) -;; (define-extern *meet-brutter-position* array) -;; (define-extern *city-save-lurkers-pipe-info* array) -;; (define-extern *city-save-lurkers-vehicle-info* object) -;; (define-extern *save-lurkers-position* array) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctysluma-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -51230,6 +51156,97 @@ (define-extern civilian-falling-post (function none :behavior civilian)) (define-extern do-spline2 (function vector vector vector vector vector float vector)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; meet-brutter ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this block was moved + +(deftype paddywagon (vehicle-guard) + ((current-level symbol :offset-assert 1076) + ) + :method-count-assert 159 + :size-assert #x438 + :flag-assert #x9f03c00438 + ) + +(deftype pw-iter-seg (structure) + ((self paddywagon :offset-assert 0) + (desired-dir vector :inline :offset-assert 16) + (score float :offset-assert 32) + (seg nav-segment :offset-assert 36) + (level symbol :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype city-lurker (civilian) + ((nav-mesh-aid uint32 :offset-assert 1060) + (index uint32 :offset-assert 1064) + (left-right-interp float :offset-assert 1068) + (front-back-interp float :offset-assert 1072) + (v-speed vector :inline :offset-assert 1088) + (end-pos vector :inline :offset-assert 1104) + (task-done? symbol :offset-assert 1120) + (task-node uint16 :offset-assert 1124) + (jump-in-pipe? symbol :offset-assert 1128) + (pipe-name string :offset-assert 1132) + (coming-from-pw symbol :offset-assert 1136) + ) + :method-count-assert 221 + :size-assert #x474 + :flag-assert #xdd04000474 + (:methods + (go-at-end () _type_ :state 218) + (go-at-pipe () _type_ :state 219) + (wait-at-end () _type_ :state 220) + ) + ) + +(deftype city-meet-brutter-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype city-save-lurkers-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + (pipe-name string :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +(deftype mystery-traffic-object-spawn-params-1 (structure) + "(anon-function 6 meet-brutter)" + ((params traffic-object-spawn-params 2 :inline) + (vec vector :inline) + (quat quaternion :inline) + ) + ) + +(define-extern *paddywagon-constants* rigid-body-vehicle-constants) +(define-extern pw-iter-seg-new-dir-level (function pw-iter-seg nav-segment none)) +(define-extern choose-next-branch-no-exit-level (function vehicle-controller paddywagon nav-branch)) +(define-extern *city-lurker-global-info* civilian-global-info) +(define-extern *city-lurker-nav-enemy-info* nav-enemy-info) +(define-extern *city-meet-brutter-vehicle-info* (inline-array city-meet-brutter-info)) +(define-extern *meet-brutter-position* (array vector)) +(define-extern *city-save-lurkers-pipe-info* (array city-save-lurkers-info)) +(define-extern *city-save-lurkers-vehicle-info* (inline-array city-save-lurkers-info)) +(define-extern *save-lurkers-position* (array vector)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; guard ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 408179fc63..41e07e66a3 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -1227,5 +1227,21 @@ "metalkor-setup": [ [1, "(function gem-tracker none)"], [2, "(function gem-tracker none)"] + ], + "meet-brutter": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"], + [2, "(function none :behavior task-manager)"], + [3, "(function symbol :behavior task-manager)"], + [4, "(function city-lurker object symbol none :behavior task-manager)"], + [5, "(function none :behavior task-manager)"], + [6, "(function none :behavior task-manager)"], + [7, "(function none :behavior task-manager)"], + [8, "(function none :behavior task-manager)"], + [9, "(function none :behavior task-manager)"], + [10, "(function none :behavior task-manager)"], + [11, "(function city-lurker object symbol none :behavior task-manager)"], + [12, "(function none :behavior task-manager)"], + [13, "(function none :behavior task-manager)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index f4a92be848..7da5ae5a02 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -98,7 +98,6 @@ "(method 10 bigmap)", "(method 9 editable-region)", // condition branch assert hit - "(anon-function 10 meet-brutter)", "(method 154 vehicle-racer)", "(method 228 hal-sewer)", "test-to-from-spr", @@ -525,7 +524,8 @@ "(method 15 vehicle-controller)": [0, 3, 5, 6, 7, 10], "(anon-function 41 guard)": [9], "(anon-function 10 metalhead-predator)": [24, 25], - "(anon-function 10 errol-chal)": [6] + "(anon-function 10 errol-chal)": [6], + "choose-next-branch-no-exit-level": [0, 6, 8, 12, 13, 16, 18, 26] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 8aec28d9fe..399f670ed1 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1654,5 +1654,22 @@ ["L430", "vector"], ["L431", "vector"], ["L423", "attack-info"] + ], + "meet-brutter": [ + ["L537", "(inline-array city-save-lurkers-info)", 6], + ["L558", "(inline-array city-meet-brutter-info)", 3], + ["L643", "uint64", true], + ["L647", "uint64", true], + ["L644", "uint64", true], + ["L646", "uint64", true], + ["L645", "uint64", true], + ["L602", "uint64", true], + ["L599", "uint64", true], + ["L601", "uint64", true], + ["L603", "uint64", true], + ["L563", "attack-info"], + ["L600", "uint64", true], + ["L551", "vector"], + ["L531", "vector"] ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 213fd1a1c9..5f4e2af21d 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -2125,5 +2125,17 @@ "(trans hang-shoot-n-launch metalkor)": [[32, "enemy-init-by-other-params"]], "(trans test metalkor)": [[32, "vector"]], "(trans explode metalkor)": [[16, "matrix"]], - "(method 12 metalkor-chain-physics)": [[560, "bounding-box"]] + "(method 12 metalkor-chain-physics)": [[560, "bounding-box"]], + "(code exit-vehicle city-lurker)": [ + [16, "vector"], + [64, "vector"] + ], + "(anon-function 6 meet-brutter)": [ + [16, "mystery-traffic-object-spawn-params-1"] + ], + "(anon-function 3 meet-brutter)": [[96, "task-arrow-params"]], + "(anon-function 13 meet-brutter)": [ + [208, "mystery-traffic-object-spawn-params-1"] + ], + "choose-next-branch-no-exit-level": [[32, "pw-iter-seg"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 97a2f323fe..ca32009d1a 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -10025,5 +10025,96 @@ [373, "v1", "art-joint-anim"], ["_stack_", 16, "res-tag"] ], - "(trans explode metalkor)": [[15, "v0", "entity-actor"]] + "(trans explode metalkor)": [[15, "v0", "entity-actor"]], + "(code board-vehicle city-lurker)": [ + [12, "v1", "vehicle"], + [166, "s1", "vehicle"], + [169, "s1", "vehicle"], + [298, "s5", "vehicle"], + [301, "s5", "vehicle"], + [306, "s5", "vehicle"], + [173, "s1", "vehicle"], + [372, "a0", "vehicle"], + [376, "a0", "vehicle"], + ["_stack_", 128, "float"] + ], + "(code ride city-lurker)": [ + [15, "v1", "vehicle"], + [116, "v1", "vehicle"] + ], + "(code exit-vehicle city-lurker)": [ + [12, "v1", "vehicle"], + [95, "s5", "vehicle"], + [98, "s5", "vehicle"], + [103, "s5", "vehicle"], + [190, "a0", "vehicle"], + [193, "a0", "vehicle"], + [256, "s3", "vehicle"], + [253, "s3", "vehicle"], + [260, "s3", "vehicle"], + [150, "s3", "vehicle"], + [153, "s3", "vehicle"], + [158, "s3", "vehicle"] + ], + "(code wait-for-ride city-lurker)": [ + [22, "v1", "art-joint-anim"], + [149, "v1", "art-joint-anim"] + ], + "(trans idle city-lurker)": [ + [14, "a0", "vehicle"], + [19, "a0", "vehicle"], + [22, "a0", "vehicle"] + ], + "(code wait-at-end city-lurker)": [[22, "v1", "art-joint-anim"]], + "(method 74 city-lurker)": [[[24, 106], "s5", "traffic-object-spawn-params"]], + "(anon-function 10 meet-brutter)": [ + [[341, 625], "s4", "city-lurker"], + [[692, 706], "s4", "city-lurker"], + [472, "s3", "vehicle"], + [492, "s3", "vehicle"], + [520, "s3", "vehicle"], + [580, "s2", "vehicle"], + [593, "s2", "vehicle"], + [182, "s5", "city-lurker"], + [276, "s4", "city-lurker"], + [281, "s4", "city-lurker"], + [76, "a1", "city-lurker"], + [22, "a1", "city-lurker"], + [30, "a1", "city-lurker"], + [186, "s5", "paddywagon"], + [192, "s5", "paddywagon"], + [198, "s5", "paddywagon"], + [229, "s5", "paddywagon"], + [235, "s5", "paddywagon"], + [258, "s5", "paddywagon"], + [261, "s5", "paddywagon"], + [274, "s5", "paddywagon"], + [285, "s5", "paddywagon"], + [297, "s5", "paddywagon"], + [277, "s5", "paddywagon"], + [283, "s4", "city-lurker"] + ], + "(anon-function 6 meet-brutter)": [ + [162, "v0", "city-lurker"], + [121, "v0", "paddywagon"] + ], + "(anon-function 3 meet-brutter)": [ + [[421, 772], "s4", "city-lurker"], + [[552, 612], "s3", "vehicle"], + [699, "s2", "vehicle"], + [712, "s2", "vehicle"], + [[262, 378], "s5", "paddywagon"], + [356, "s4", "process-focusable"], + [361, "s4", "process-focusable"], + [201, "a0", "city-lurker"], + [78, "a1", "city-lurker"], + [169, "a0", "city-lurker"], + [23, "a2", "city-lurker"], + [31, "a2", "city-lurker"], + [363, "s4", "process-focusable"] + ], + "(anon-function 13 meet-brutter)": [ + [215, "v0", "city-lurker"], + [174, "v0", "paddywagon"] + ] } diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index bef3ea6311..b49b4e81ca 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -35,6 +35,7 @@ (citizen-fat 2) (citizen-norm-2 3) (crimson-guard-0 4) + (tt5 5) (crimson-guard-1 6) (crimson-guard-2 7) (metalhead-grunt 8) @@ -46,6 +47,7 @@ (cara 14) (carb 15) (carc 16) + (tt17 17) (guard-bike 18) (hellcat 19) (traffic-type-20 20) diff --git a/goal_src/jak2/levels/city/common/ctywide-obs.gc b/goal_src/jak2/levels/city/common/ctywide-obs.gc index 24792d01fe..13f3792ebf 100644 --- a/goal_src/jak2/levels/city/common/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/common/ctywide-obs.gc @@ -7,3 +7,278 @@ ;; DECOMP BEGINS +(defskelgroup skel-lurker-pipe-lid lurker-pipe-lid lurker-pipe-lid-lod0-jg lurker-pipe-lid-idle-ja + ((lurker-pipe-lid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +(deftype lurker-pipe-lid (process-focusable) + ((angle degrees :offset-assert 204) + (rot float :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 31 + :size-assert #xd4 + :flag-assert #x1f006000d4 + (:methods + (idle () _type_ :state 27) + (lurker-pipe-lid-method-28 (_type_) none 28) + (lurker-pipe-lid-method-29 (_type_) none 29) + (lurker-pipe-lid-method-30 (_type_) none 30) + ) + ) + + +(defstate idle (lurker-pipe-lid) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('spin) + (set! (-> self angle) 196608.0) + (set! (-> self rot) -655360.0) + ) + ) + ) + ) + :enter (behavior () + '() + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + '() + (none) + ) + :code (the-as (function none :behavior lurker-pipe-lid) sleep-code) + :post (behavior () + (if (< 0.0 (-> self angle)) + (set! (-> self angle) + (- (-> self angle) + (* 6.0 (-> self clock seconds-per-frame) (fmax 1820.4445 (fmin (-> self angle) (-> self angle)))) + ) + ) + (set! (-> self angle) 0.0) + ) + (quaternion-vector-angle! (-> self root-override quat) *x-vector* (-> self angle)) + (ja-post) + (none) + ) + ) + +(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((obj lurker-pipe-lid)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((obj lurker-pipe-lid)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! lurker-pipe-lid ((obj lurker-pipe-lid) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (lurker-pipe-lid-method-28 obj) + (process-drawable-from-entity! obj arg0) + (ctywide-entity-hack) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-lurker-pipe-lid" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (lurker-pipe-lid-method-29 obj) + (set! (-> obj angle) 0.0) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype ctyn-lamp (process-focusable) + () + :heap-base #x50 + :method-count-assert 31 + :size-assert #xcc + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (ctyn-lamp-method-29 (_type_) none 29) + (ctyn-lamp-method-30 (_type_) none 30) + ) + ) + + +(defskelgroup skel-ctyn-lamp ctyn-lamp ctyn-lamp-lod0-jg ctyn-lamp-idle-ja + ((ctyn-lamp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-ctyn-lamp-explode ctyn-lamp ctyn-lamp-explode-lod0-jg ctyn-lamp-explode-idle-ja + ((ctyn-lamp-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *ctyn-lamp-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +(defstate idle (ctyn-lamp) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (-> event param 1) + (let ((s5-0 (the-as process-drawable proc)) + (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) + ) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> s5-0 root trans quad)) + (set! (-> gp-0 fountain-rand-transv-hi x) 16384.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 40960.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-ctyn-lamp-explode" (the-as (pointer uint32) #f)) + 5 + gp-0 + *ctyn-lamp-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + :code (the-as (function none :behavior ctyn-lamp) sleep-code) + ) + +(defstate die (ctyn-lamp) + :virtual #t + :enter (the-as (function none :behavior ctyn-lamp) #f) + :exit (the-as (function none :behavior ctyn-lamp) #f) + :trans (the-as (function none :behavior ctyn-lamp) #f) + :code (behavior () + (sound-play "lamp-hit") + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior ctyn-lamp) #f) + ) + +(defmethod ctyn-lamp-method-29 ctyn-lamp ((obj ctyn-lamp)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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 ((v1-7 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 0) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod ctyn-lamp-method-30 ctyn-lamp ((obj ctyn-lamp)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ctyn-lamp ((obj ctyn-lamp) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (ctyn-lamp-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyn-lamp" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ctyn-lamp-method-30 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc index ab5438c72d..d7ebc91ada 100644 --- a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc +++ b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc @@ -5,5 +5,3342 @@ ;; name in dgo: meet-brutter ;; dgos: LMEETBRT +(deftype mystery-traffic-object-spawn-params-1 (structure) + "(anon-function 6 meet-brutter)" + ((params traffic-object-spawn-params 2 :inline) + (vec vector :inline) + (quat quaternion :inline) + ) + ) + ;; DECOMP BEGINS +(defmethod draw hud-lurker ((obj hud-lurker)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-lurker ((obj hud-lurker)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-lurker ((obj hud-lurker)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +(defskelgroup skel-paddywagon paddy-wagon paddy-wagon-lod0-jg paddy-wagon-idle-ja + ((paddy-wagon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.4) + :shadow paddy-wagon-shadow-mg + :origin-joint-index 3 + ) + +(define *paddywagon-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.1 + :friction-factor 0.05 + :cm-offset-joint (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 3) (meters 7)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*paddywagon-constants* + :flags #xc + :object-type #x13 + :guard-type #x5 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 60.0 + :engine-intake-factor 1.5 + :brake-factor 3.5 + :turbo-boost-factor 1.0 + :max-xz-speed (meters 40) + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261824 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 5.0 + :steering-thruster-max-gain 4.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-friction-factor 0.5 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000034877234 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.5 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :target-speed-offset (meters -2) + :turning-accel (meters 45) + :toughness-factor 1.0 + :damage-factor 6.0 + :camera-string-min-height (meters 4.5) + :camera-string-max-height (meters 4.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 12.5) + :camera-min-fov 15109.688 + :camera-max-fov 17476.268 + :camera-head-offset 8192.0 + :camera-foot-offset 4096.0 + :camera-normal-max-angle-offset 182.04445 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :seat-count 2 + :rider-stance #x1 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :y 9420.8 :z 2457.6 :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 819.2 :z -13107.2 :w (the-as float #x48000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0) + (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0) + ) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select #x8 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "car-glance-stn") + :impact-sound (static-sound-name "car-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.4) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :z -2048.0 :w 1.0) + (new 'static 'vector :z -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 12288.0 :y 9216.0 :z -5734.4 :w 1.0) + (new 'static 'vector :x -12288.0 :y 9216.0 :z -5734.4 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15564.8 :y 9216.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x -15564.8 :y 9216.0 :z -17203.2 :w 1.0) + ) + :lift-thruster-count 2 + :roll-thruster-count 2 + :steering-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 5734.4 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -9830.4 :w 1.0) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-control-point 6 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :normal (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point) + (new 'static 'vehicle-control-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :color-option-count 1 + :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + ) + ) + +(deftype paddywagon (vehicle-guard) + ((current-level symbol :offset-assert 1076) + ) + :heap-base #x3c0 + :method-count-assert 159 + :size-assert #x438 + :flag-assert #x9f03c00438 + ) + + +(defmethod allocate-and-init-cshape paddywagon ((obj paddywagon)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 26624.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 8192.0 -14336.0 11468.8) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 12288.0 7372.8 -12288.0 8192.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) -12288.0 7372.8 -12288.0 8192.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 0.0 6144.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 9011.2 7372.8 4915.2) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (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! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +(deftype pw-iter-seg (structure) + ((self paddywagon :offset-assert 0) + (desired-dir vector :inline :offset-assert 16) + (score float :offset-assert 32) + (seg nav-segment :offset-assert 36) + (level symbol :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + + +;; WARN: Return type mismatch nav-segment vs none. +(defun pw-iter-seg-new-dir-level ((arg0 pw-iter-seg) (arg1 nav-segment)) + (-> arg0 self) + (let ((a1-1 (-> arg1 branch src-node)) + (v1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-2 quad) (-> a1-1 position quad)) + (set! (-> v1-2 w) 1.0) + (let ((a2-0 (-> arg1 branch dest-node)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a2-0 position quad)) + (set! (-> a0-4 w) 1.0) + (set! (-> v1-2 y) 0.0) + (set! (-> a0-4 y) 0.0) + (set! (-> v1-2 w) 1.0) + (set! (-> a0-4 w) 1.0) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) a0-4 v1-2))) + 0.0 + (vector-normalize! s4-1 1.0) + (let ((f0-8 (vector-dot s4-1 (-> arg0 desired-dir)))) + (when (and (< (-> arg0 score) f0-8) + (= (-> arg0 level) (-> arg1 branch src-node level)) + (= (-> arg0 level) (-> arg1 branch dest-node level)) + ) + (set! (-> arg0 score) f0-8) + (set! (-> arg0 seg) arg1) + ) + ) + ) + ) + ) + (none) + ) + +(defun choose-next-branch-no-exit-level ((arg0 vehicle-controller) (arg1 paddywagon)) + (let ((gp-0 (the-as nav-branch #f))) + (let* ((s3-0 (-> arg0 branch dest-node)) + (s2-0 (-> s3-0 branch-count)) + ) + (b! (!= s2-0 1) cfg-7 :delay (empty-form)) + (let ((v1-4 (-> s3-0 branch-array 0))) + (if (and (!= (-> v1-4 dest-node id) #xffff) (= (-> s3-0 level) (-> v1-4 dest-node level))) + (set! gp-0 v1-4) + ) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-7) + (when (< 1 s2-0) + (let ((v1-6 (rand-vu-int-count s2-0)) + (a0-10 s2-0) + ) + (b! #t cfg-16 :delay (nop!)) + (label cfg-9) + (+! a0-10 -1) + (let ((a1-6 (-> s3-0 branch-array v1-6))) + (b! + (not (and (!= (-> a1-6 dest-node id) #xffff) (= (-> s3-0 level) (-> a1-6 dest-node level)))) + cfg-14 + :delay (empty-form) + ) + (set! gp-0 a1-6) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-14) + (+! v1-6 1) + (if (>= v1-6 s2-0) + (set! v1-6 0) + ) + (label cfg-16) + (b! (nonzero? a0-10) cfg-9 :delay (nop!)) + ) + ) + ) + (label cfg-18) + (let ((s3-1 4)) + (let ((f30-0 122880.0)) + (b! #t cfg-22 :delay (nop!)) + (label cfg-19) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'pw-iter-seg)) + ) + (let ((v1-10 + (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root-override-2 quat))) + ) + ) + (set! (-> s1-0 quad) (-> arg1 root-override-2 trans quad)) + (set! (-> s1-0 w) f30-0) + (set! (-> s2-1 seg) #f) + (set! (-> s2-1 score) 0.0) + (set! (-> s2-1 level) (-> arg0 branch src-node level)) + (set! (-> s2-1 desired-dir quad) (-> v1-10 quad)) + ) + (vector-normalize! (-> s2-1 desired-dir) 1.0) + (set! (-> s2-1 self) arg1) + (callback-on-nav-segments-in-sphere + (-> arg1 controller traffic) + s1-0 + 0 + (the-as traffic-find-segment-struct s2-1) + (the-as (function traffic-find-segment-struct nav-segment none) pw-iter-seg-new-dir-level) + ) + (if (-> s2-1 seg) + (set! gp-0 (-> s2-1 seg branch)) + ) + ) + (format #t "new branch in level picked~%") + (+! s3-1 -1) + (set! f30-0 (+ 81920.0 f30-0)) + ) + (label cfg-22) + (b! (and (nonzero? s3-1) (not gp-0)) cfg-19 :delay (nop!)) + ) + (if (not gp-0) + (format *stdcon* "no branch~%") + ) + gp-0 + ) + ) + +(defmethod init-skel-and-rigid-body paddywagon ((obj paddywagon)) + (with-pp + (set! (-> pp level) (level-get *level* 'lmeetbrt)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-paddywagon" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (alloc-and-init-rigid-body-control obj *paddywagon-constants*) + (set! (-> obj draw lod-set lod 0 dist) 819200.0) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> obj flags))) + ) + (set! (-> obj controller choose-branch-callback) choose-next-branch-no-exit-level) + 0 + (none) + ) + ) + +(defmethod vehicle-method-120 paddywagon ((obj paddywagon)) + (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) + (t9-0 obj) + ) + (if (logtest? (-> obj controller flags) (vehicle-controller-flag attached)) + (set! (-> obj current-level) (-> obj controller branch dest-node level)) + (set! (-> obj current-level) #f) + ) + (vehicle-method-119 obj) + 0 + (none) + ) + +(defmethod vehicle-method-128 paddywagon ((obj paddywagon)) + (let ((t9-0 (method-of-type vehicle vehicle-method-128))) + (t9-0 obj) + ) + (logior! (-> obj flags) (rigid-body-object-flag persistent)) + 0 + (none) + ) + +(defmethod vehicle-method-127 paddywagon ((obj paddywagon)) + ((method-of-type vehicle vehicle-method-127) obj) + 0 + (none) + ) + +(defmethod vehicle-method-129 paddywagon ((obj paddywagon)) + ((method-of-type vehicle vehicle-method-129) obj) + 0 + (none) + ) + +(defmethod vehicle-method-134 paddywagon ((obj paddywagon) (arg0 process)) + "Stubbed" + (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (set! (-> obj controller target-speed-offset) 81920.0) + (set! (-> obj pursuit-target) (process->handle arg0)) + (set! (-> obj flags) (logior (rigid-body-object-flag alert) (-> obj flags))) + (if (task-node-open? (game-task-node city-save-lurkers-save-lurkers)) + (vehicle-method-111 obj 1 (the-as target arg0)) + (vehicle-method-111 obj 2 (the-as target arg0)) + ) + (go (method-of-object obj hostile)) + 0 + (none) + ) + +(defmethod vehicle-method-108 paddywagon ((obj paddywagon)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) + ) + (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + 0 + (none) + ) + +(defstate active (paddywagon) + :virtual #t + :enter (behavior () + (vehicle-method-107 self) + (let ((t9-1 (-> (method-of-type vehicle-guard active) enter))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +(defstate hostile (paddywagon) + :virtual #t + :enter (behavior () + '() + (none) + ) + :trans (the-as (function none :behavior paddywagon) #f) + :code (the-as (function none :behavior paddywagon) sleep-code) + :post (behavior () + (vehicle-guard-method-158 self) + (none) + ) + ) + +(defstate die (paddywagon) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +(defskelgroup skel-city-lurker babak babak-lod0-jg babak-idle-ja + ((babak-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow babak-shadow-mg + ) + +(define *city-lurker-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 6 6) + :knocked-land (new 'static 'array int32 2 7 7) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + ) + :anim-cover-head-start 3 + :anim-cover-head-loop 3 + :anim-cover-head-end 3 + :car-stance-anim 10 + :get-in-car-anim 8 + :get-on-bike-anim 16 + :seat-flag #x4 + ) + ) + +(define *city-lurker-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 6 + :knocked-land-anim 7 + :die-anim 3 + :die-falling-anim 3 + :victory-anim 3 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :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 61440.0 + :knocked-soft-vxz-hi 102400.0 + :knocked-soft-vy-lo 40960.0 + :knocked-soft-vy-hi 81920.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 204800.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 163840.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 20480.0 + :knocked-yellow-vxz-hi 40960.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 65536.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 49152.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 65536.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 #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim 3 + :run-anim 5 + :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 1) + :walk-turning-acceleration (meters 30) + :maximum-rotation-rate (degrees 720.0) + :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! (-> *city-lurker-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype city-lurker (civilian) + ((nav-mesh-aid uint32 :offset-assert 1060) + (index uint32 :offset-assert 1064) + (left-right-interp float :offset-assert 1068) + (front-back-interp float :offset-assert 1072) + (v-speed vector :inline :offset-assert 1088) + (end-pos vector :inline :offset-assert 1104) + (task-done? symbol :offset-assert 1120) + (task-node uint16 :offset-assert 1124) + (jump-in-pipe? symbol :offset-assert 1128) + (pipe-name string :offset-assert 1132) + (coming-from-pw symbol :offset-assert 1136) + ) + :heap-base #x400 + :method-count-assert 221 + :size-assert #x474 + :flag-assert #xdd04000474 + (:methods + (go-at-end () _type_ :state 218) + (go-at-pipe () _type_ :state 219) + (wait-at-end () _type_ :state 220) + ) + ) + + +(defstate knocked (city-lurker) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((s5-0 (find-nearest-nav-mesh (-> self root-override2 trans) (the-as float #x7f800000))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (if s5-0 + (set! (-> self nav-mesh-aid) (-> s5-0 entity aid)) + ) + (change-to s5-0 self) + (if (not (-> self nav)) + (go-inactive self) + ) + (set! (-> self nav-mesh-aid) (-> s5-0 entity aid)) + (let ((v1-17 (-> self nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (do-navigation-to-destination (-> self nav state) (-> self root-override2 trans)) + (cond + ((-> self coming-from-pw) + (let ((s5-1 (-> self nav)) + (s4-0 (method-of-type nav-control cloest-point-on-mesh)) + (s3-0 gp-0) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (let ((s1-0 (-> self root-override2 trans))) + (let ((v1-27 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)))) + (let ((a0-7 20480.0)) + (.mov vf7 a0-7) + ) + (.lvf vf5 (&-> v1-27 quad)) + ) + (.lvf vf4 (&-> s1-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-0 quad) vf6) + (s4-0 s5-1 s3-0 s2-0 (the-as nav-poly #f)) + ) + (set! (-> self root-override2 transv x) (- (-> gp-0 x) (-> self root-override2 trans x))) + (set! (-> self root-override2 transv y) 40960.0) + (set! (-> self root-override2 transv z) (- (-> gp-0 z) (-> self root-override2 trans z))) + (set! (-> self coming-from-pw) #f) + ) + (else + (cloest-point-on-mesh (-> self nav) gp-0 (-> self root-override2 trans) (the-as nav-poly #f)) + (when (< 4096.0 (vector-vector-xz-distance gp-0 (-> self root-override2 trans))) + (set! (-> self root-override2 transv x) (- (-> gp-0 x) (-> self root-override2 trans x))) + (set! (-> self root-override2 transv y) 40960.0) + (set! (-> self root-override2 transv z) (- (-> gp-0 z) (-> self root-override2 trans z))) + ) + ) + ) + ) + (set! (-> self gnd-height) (-> self root-override2 gspot-pos y)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'on-ground) + (let ((t9-9 send-event-function) + (v1-55 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-9 + (handle->process (if (-> v1-55 info) + (-> v1-55 info manager) + (the-as handle #f) + ) + ) + a1-7 + ) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (vector-y-quaternion! s5-2 (-> self root-override2 quat)) + (vector-normalize! s5-2 1.0) + (quaternion-from-two-vectors! gp-1 s5-2 *up-vector*) + (quaternion*! (-> self root-override2 quat) gp-1 (-> self root-override2 quat)) + ) + (none) + ) + ) + ) + +(defstate move-to-vehicle (city-lurker) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + ) + +(defstate board-vehicle (city-lurker) + :virtual #t + :code (behavior () + (local-vars (sv-128 float) (sv-144 float) (sv-160 float)) + (let ((gp-0 0)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (set! gp-0 (-> self info get-on-bike-anim)) + ) + ((14 15 16) + (set! gp-0 (-> self info get-in-car-anim)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! min) + (let ((f30-0 0.0)) + (while (< f30-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f30-0 f30-0 f30-0) (* 3.0 f30-0 f30-0)) 0.0 1.0) + ) + (suspend) + (+! f30-0 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self root-override2 trans quad)) + (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override2 quat)))) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 8.0 0)) + :frame-num (ja-aframe 2.0 0) + ) + (until (ja-done? 0) + (let ((s1-0 (handle->process (-> self vehicle))) + (s0-0 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s1-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s2-0 (-> (the-as vehicle s1-0) root-override-2 quat)) + (compute-seat-position (the-as vehicle s1-0) s0-0 (-> self seat)) + (vector-! s3-1 s0-0 s5-2) + (let ((s1-1 lerp-scale) + (s0-1 0.0) + ) + (set! sv-128 (the-as float 1.0)) + (set! sv-144 (ja-aframe-num 0)) + (set! sv-160 (ja-aframe 2.0 0)) + (let* ((t0-1 (ja-aframe 8.0 0)) + (f30-1 (s1-1 s0-1 sv-128 sv-144 sv-160 t0-1)) + ) + (quaternion-slerp! (-> self root-override2 quat) s4-0 s2-0 f30-1) + (vector+float*! (-> self root-override2 trans) s5-2 s3-1 f30-1) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0))) + ) + ) + ) + (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override2 quat)) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 10.0 0)) + :frame-num (ja-aframe 8.0 0) + ) + ) + (until (ja-done? 0) + (let ((s5-4 (handle->process (-> self vehicle))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (if (not s5-4) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-1 (-> (the-as vehicle s5-4) root-override-2 quat)) + (compute-seat-position (the-as vehicle s5-4) (-> self root-override2 trans) (-> self seat)) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 8.0 0) (ja-aframe 10.0 0)) + (quaternion-copy! (-> self root-override2 quat) gp-1) + ) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + (none) + ) + ) + +(defmethod get-inv-mass city-lurker ((obj city-lurker)) + 0.25 + ) + +(defstate in-ditch (city-lurker) + :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 + ) + ) + ) + (none) + ) + ) + +(defstate ride (city-lurker) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian ride) exit))) + (if t9-0 + (t9-0) + ) + ) + (let* ((v1-5 (-> self skel float-channels)) + (a0-2 (if (= v1-5 1) + (-> self skel channel (-> self skel active-channels)) + (the-as joint-control-channel #f) + ) + ) + ) + (if a0-2 + (joint-channel-float-delete! a0-2) + ) + ) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (civilian-method-217 self a1-0) + ) + (let ((t9-1 (-> (method-of-type civilian ride) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (handle->process (-> self vehicle)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 3 (seconds 0.2)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (ja :group! (-> self draw art-group data 12)) + (ja :chan 1 :group! (-> self draw art-group data 13)) + (ja :chan 2 :group! (-> self draw art-group data 14)) + ) + ((14 15 16) + (ja :group! (-> self draw art-group data 9)) + (ja :chan 1 :group! (-> self draw art-group data 10)) + (ja :chan 2 :group! (-> self draw art-group data 11)) + ) + ) + (let ((v1-26 (ja-channel-float! (the-as art-joint-anim (-> self draw art-group data 15)) 0.0 0.0 0.0))) + (when v1-26 + (set! (-> self skel interp-select 0) (the-as int (the-as uint #x8100002000))) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-26 param 0) 1.0) + (set! (-> v1-26 num-func) num-func-loop!) + ) + ) + (until #f + (let ((v1-28 (handle->process (-> self vehicle)))) + (when v1-28 + (let* ((v1-30 (-> (the-as vehicle v1-28) rbody)) + (a1-10 (-> self root-override2 trans)) + (a2-1 (new 'stack-no-clear 'vector)) + (gp-0 (rigid-body-method-22 (-> v1-30 state) a1-10 a2-1)) + ) + (vector-inv-orient-by-quat! gp-0 gp-0 (-> self root-override2 quat)) + (seek! (-> self v-speed x) (-> gp-0 x) (* 81920.0 (-> self clock seconds-per-frame))) + (seek! (-> self v-speed z) (-> gp-0 z) (* 49152.0 (-> self clock seconds-per-frame))) + (set! (-> self left-right-interp) + (fmax + 0.0 + (fmin + 2.0 + (+ (-> self left-right-interp) + (* 8.0 + (- (lerp-scale 0.0 2.0 (-> gp-0 x) -20480.0 20480.0) (-> self left-right-interp)) + (-> self clock seconds-per-frame) + ) + ) + ) + ) + ) + (set! (-> self front-back-interp) + (fmax + 0.0 + (fmin + 2.0 + (+ (-> self front-back-interp) + (* 8.0 + (- (lerp-scale 0.0 2.0 (- (-> self v-speed z) (-> gp-0 z)) -16384.0 16384.0) (-> self front-back-interp)) + (-> self clock seconds-per-frame) + ) + ) + ) + ) + ) + (let ((s5-0 (-> self skel root-channel 0))) + (let ((f0-29 (lerp-scale 0.0 1.0 (-> self front-back-interp) 1.0 0.0))) + (set! (-> s5-0 frame-interp 1) f0-29) + (set! (-> s5-0 frame-interp 0) f0-29) + ) + (set! (-> s5-0 num-func) num-func-identity) + (set! (-> s5-0 frame-num) (ja-aframe (-> self left-right-interp) 0)) + ) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-36 (if (>= 1.0 (-> self front-back-interp)) + (-> self front-back-interp) + (- 2.0 (-> self front-back-interp)) + ) + ) + ) + (set! (-> s5-1 frame-interp 1) f0-36) + (set! (-> s5-1 frame-interp 0) f0-36) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe (-> self left-right-interp) 1)) + ) + (let ((s5-2 (-> self skel root-channel 2))) + (let ((f0-40 (lerp-scale 0.0 1.0 (-> self front-back-interp) 1.0 2.0))) + (set! (-> s5-2 frame-interp 1) f0-40) + (set! (-> s5-2 frame-interp 0) f0-40) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe (-> self left-right-interp) 2)) + ) + (let* ((v1-59 (-> self skel float-channels)) + (s5-3 (if (= v1-59 1) + (-> self skel channel (-> self skel active-channels)) + (the-as joint-control-channel #f) + ) + ) + ) + (when s5-3 + (set! (-> s5-3 frame-interp 0) 0.0) + (set! (-> s5-3 frame-interp 1) + (lerp-scale 0.0 1.0 (sqrtf (+ (* (-> gp-0 x) (-> gp-0 x)) (* (-> gp-0 z) (-> gp-0 z)))) 0.0 122880.0) + ) + (set! (-> s5-3 param 0) 2.0) + ) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + ) + +(defstate exit-vehicle (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + (let ((a0-2 (find-nearest-nav-mesh (-> self root-override2 trans) (the-as float #x7f800000)))) + (if a0-2 + (set! (-> self nav-mesh-aid) (-> a0-2 entity aid)) + ) + (change-to a0-2 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-override2 quat))) + ) + (let ((a0-9 (-> self nav state)) + (v1-17 (-> self controller turn-exit-point)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + ) + 0 + (citizen-nav-init! self) + (set! (-> self gnd-height) (-> self root-override2 gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self focus-status) (logior (focus-status pilot-riding pilot) (-> self focus-status))) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-31 (-> self root-override2 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 + (none) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) + (if t9-0 + (t9-0) + ) + ) + (none) + ) + :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + (local-vars (sv-128 float)) + (let ((gp-0 0)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (set! gp-0 (-> self info get-on-bike-anim)) + ) + ((14 15 16) + (set! gp-0 (-> self info get-in-car-anim)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 8.0 0) 0.6666667) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (let ((s5-1 (handle->process (-> self vehicle)))) + (new 'stack-no-clear 'vector) + (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle s5-1) root-override-2 quat)) + (compute-seat-position (the-as vehicle s5-1) (-> self root-override2 trans) (-> self seat)) + ) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.6666667)) + ) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (civilian-method-217 self s5-3)) + (let ((s3-0 (handle->process (-> self vehicle)))) + (new 'stack-no-clear 'vector) + (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle s3-0) root-override-2 quat)) + (compute-seat-position (the-as vehicle s3-0) (-> self root-override2 trans) (-> self seat)) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (go-virtual ride) + ) + (suspend) + ) + (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (quaternion-copy! s4-0 (-> self root-override2 quat)) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 2.0 0) 0.6666667) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (let ((s3-1 (handle->process (-> self vehicle))) + (s2-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (s4-2 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s4-2 (-> (the-as vehicle s3-1) root-override-2 quat)) + (compute-seat-position (the-as vehicle s3-1) s2-0 (-> self seat)) + (vector-! gp-1 s2-0 s5-3) + (let ((s3-2 lerp-scale) + (s2-1 0.0) + (s1-0 1.0) + (s0-0 (ja-aframe-num 0)) + ) + (set! sv-128 (ja-aframe 8.0 0)) + (let* ((t0-1 (ja-aframe 2.0 0)) + (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-1)) + (f30-0 (- 1.0 f0-9)) + ) + (quaternion-copy! (-> self root-override2 quat) s4-2) + (vector+float*! (-> self root-override2 trans) s5-3 gp-1 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 2.0 0) 0.6666667)) + ) + ) + ) + (let ((v1-83 (-> self root-override2 root-prim))) + (set! (-> v1-83 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-83 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (go-virtual wait-for-ride) + (none) + ) + ) + +(defstate wait-for-ride (city-lurker) + :virtual #t + :enter (behavior () + (when (-> self task-done?) + (if (-> self jump-in-pipe?) + (go-virtual go-at-pipe) + (go-virtual go-at-end) + ) + ) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-15 (-> self nav))) + (set! (-> v1-15 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-17 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-17 enemy-flags))) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-17 enemy-flags)))) + ) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-17 enemy-flags)))) + (set! (-> v1-17 nav callback-info) (-> v1-17 enemy-info-override callback-info)) + ) + 0 + (let ((v1-20 self)) + (set! (-> v1-20 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-20 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type civilian wait-for-ride) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 163840.0) + (if (-> self jump-in-pipe?) + (go-virtual go-at-pipe) + (go-virtual go-at-end) + ) + ) + (none) + ) + :code (behavior () + (until #f + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override run-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override run-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (when (or (< 245760.0 (vector-vector-distance (-> self root-override2 trans) (target-pos 0))) + (< (vector-vector-distance (-> self root-override2 trans) (target-pos 0)) 24576.0) + ) + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 target-speed) 0.0) + ) + 0 + (let ((v1-39 self)) + (set! (-> v1-39 enemy-flags) (the-as enemy-flag (logclear (-> v1-39 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-39 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-42 self)) + (set! (-> v1-42 enemy-flags) (the-as enemy-flag (logclear (-> v1-42 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + #t + (goto cfg-13) + ) + ) + #f + (label cfg-13) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (when (and (< (vector-vector-distance (-> self root-override2 trans) (target-pos 0)) 245760.0) + (< 32768.0 (vector-vector-distance (-> self root-override2 trans) (target-pos 0))) + ) + (nav-enemy-method-166 self) + (let ((v1-87 (-> self nav))) + (set! (-> v1-87 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-89 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-89 enemy-flags))) + (set! (-> v1-89 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-89 enemy-flags)))) + ) + (set! (-> v1-89 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-89 enemy-flags)))) + (set! (-> v1-89 nav callback-info) (-> v1-89 enemy-info-override callback-info)) + ) + 0 + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-92 enemy-flags)))) + ) + 0 + #t + (goto cfg-28) + ) + ) + #f + (label cfg-28) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-1 (target-pos 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +(defstate go-at-end (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info-override callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-11 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (when (and (-> self jump-in-pipe?) + (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 24576.0) + ) + (logclear! (-> self flags) (citizen-flag persistent)) + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'task-done) + (let ((t9-1 send-event-function) + (v1-15 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-1 + (handle->process (if (-> v1-15 info) + (-> v1-15 info manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + (let ((v1-22 (-> self root-override2 root-prim))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) + (send-event self 'jump 0 (-> self end-pos)) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (logtest? (-> self nav state flags) (nav-state-flag at-target)) + ) + (go-virtual wait-at-end) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self end-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +(defstate go-at-pipe (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info-override callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-11 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack 'sphere))) + (set! (-> gp-0 quad) (-> self end-pos quad)) + (set! (-> gp-0 r) 12288.0) + (when (and (-> self jump-in-pipe?) + (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 28672.0) + (not (add-root-sphere-to-hash! (-> self nav) gp-0 38)) + ) + (logclear! (-> self flags) (citizen-flag persistent)) + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'task-done) + (let ((t9-3 send-event-function) + (v1-20 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-3 + (handle->process (if (-> v1-20 info) + (-> v1-20 info manager) + (the-as handle #f) + ) + ) + a1-3 + ) + ) + ) + ) + (let ((v1-27 (-> self root-override2 root-prim))) + (set! (-> v1-27 prim-core collide-as) (collide-spec)) + (set! (-> v1-27 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) + (send-event self 'jump 0 (-> self end-pos)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self end-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +(defmethod enemy-method-86 city-lurker ((obj city-lurker)) + (let ((gp-0 (-> obj root-override2))) + (when (< (-> gp-0 transv y) 0.0) + (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> obj end-pos y))) (-> obj jump-in-pipe?)) + (send-event (process-by-name (-> obj pipe-name) *active-pool*) 'spin) + (set! (-> obj jump-in-pipe?) #f) + ) + (>= (-> obj end-pos y) (-> gp-0 trans y)) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod enemy-method-93 city-lurker ((obj city-lurker)) + (go (method-of-object obj inactive)) + (none) + ) + +(defmethod enemy-method-89 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + #f + ) + +(defmethod enemy-method-87 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + (let ((a0-1 (-> obj skel root-channel 0))) + (set! (-> a0-1 param 0) 1.0) + (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> obj skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (set! (-> s5-0 param 0) (ja-aframe 6.0 0)) + (set! (-> s5-0 param 1) 0.5) + (set! (-> s5-0 frame-num) (ja-aframe 0.0 0)) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + ) + #t + ) + +(defmethod enemy-method-88 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + #f + ) + +(defstate wait-at-end (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'task-done) + (let ((t9-0 send-event-function) + (v1-16 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-0 + (handle->process (if (-> v1-16 info) + (-> v1-16 info manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + ) + (none) + ) + :trans (behavior () + '() + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + (none) + ) + :post (behavior () + (nav-enemy-simple-post) + (none) + ) + ) + +(defmethod coin-flip? city-lurker ((obj city-lurker)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +(defmethod damage-amount-from-attack city-lurker ((obj city-lurker) (arg0 process) (arg1 event-message-block)) + "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" + 0 + ) + +(defstate inactive (city-lurker) + :virtual #t + :enter (behavior () + (format #t "city-lurker inactive~%") + (let ((t9-1 (-> (method-of-type civilian inactive) enter))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +(defstate active (city-lurker) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian active) enter))) + (if t9-0 + (t9-0) + ) + ) + (format #t "city-lurker active~%") + (none) + ) + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +(defstate get-up-front (city-lurker) + :virtual #t + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +(defstate get-up-back (city-lurker) + :virtual #t + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +(defstate idle (city-lurker) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (enemy-event-handler proc arg1 event-type event) + ) + (else + (enemy-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (citizen-init! self) + (set! (-> self hit-points) 100) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-8 (-> self root-override2 root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-10 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self focus-status) (logior (focus-status pilot-riding pilot) (-> self focus-status))) + (set! (-> self coming-from-pw) #t) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (none) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self vehicle)))) + (when (or (not a0-1) (logtest? (-> (the-as vehicle a0-1) flags) (rigid-body-object-flag dead))) + (if a0-1 + (remove-rider (the-as vehicle a0-1) self) + ) + (let ((v1-9 (-> self root-override2 root-prim))) + (set! (-> v1-9 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-9 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (set! (-> self vehicle) (the-as handle #f)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)))) + (set! (-> gp-0 y) 1.0) + (vector-normalize! gp-0 40960.0) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'attack) + (set! (-> a1-6 param 0) (the-as uint #f)) + (let ((v1-15 (new 'static 'attack-info :mask (attack-info-mask vector id knock)))) + (let* ((a0-11 *game-info*) + (a2-1 (+ (-> a0-11 attack-id) 1)) + ) + (set! (-> a0-11 attack-id) a2-1) + (set! (-> v1-15 id) a2-1) + ) + (set! (-> v1-15 vector quad) (-> gp-0 quad)) + (set! (-> v1-15 knock) (the-as uint 7)) + (set! (-> a1-6 param 1) (the-as uint v1-15)) + ) + (send-event-function self a1-6) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (countdown (gp-0 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 4.0 0) 0.25) + :frame-num (ja-aframe 0.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 0.25)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 8.0 0) 0.5) + :frame-num (ja-aframe 4.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (cond + ((zero? (rand-vu-int-count 2)) + (countdown (gp-3 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 12.0 0) 0.25) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.25)) + ) + ) + ) + (else + (countdown (gp-4 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 16.0 0) 0.4) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0) 0.4)) + ) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 4.0 0) 0.5) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 0.5)) + ) + ) + #f + (none) + ) + :post (behavior () + (transform-post) + (none) + ) + ) + +(defmethod set-behavior! city-lurker ((obj city-lurker) (arg0 traffic-object-spawn-params)) + (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object obj idle)) + ) + ((= v1-0 2) + (go (method-of-object obj active)) + ) + ((= v1-0 3) + (go (method-of-object obj hostile)) + ) + ((= v1-0 6) + (logior! (-> obj flags) (citizen-flag persistent)) + (go (method-of-object obj idle)) + ) + ((= v1-0 7) + (logior! (-> obj flags) (citizen-flag persistent)) + (go (method-of-object obj wait-for-ride)) + ) + (else + (go-inactive obj) + ) + ) + ) + 0 + (none) + ) + +(defmethod citizen-init! city-lurker ((obj city-lurker)) + "Initialize [[citizen]] defaults." + (let ((t9-0 (method-of-type civilian citizen-init!))) + (t9-0 obj) + ) + (let ((v1-1 (-> obj nav))) + (set! (-> v1-1 sphere-mask) (the-as uint #x800fe)) + ) + 0 + (none) + ) + +(defmethod init-enemy-collision! city-lurker ((obj city-lurker)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (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! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! city-lurker ((obj city-lurker)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-city-lurker" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-enemy-behaviour-and-stats! obj *city-lurker-nav-enemy-info*) + (set! (-> obj info) *city-lurker-global-info*) + (let ((v1-6 (-> obj nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> obj draw lod-set lod 1 dist) 491520.0) + (set! (-> obj speed-run) 20480.0) + (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) + (set! (-> obj water-anim) 20) + (set! (-> obj jump-in-pipe?) #f) + (set! (-> obj task-done?) #f) + (set! (-> obj coming-from-pw) #f) + 0 + (none) + ) + +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 134] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 139] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 110] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 118] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] +(defmethod general-event-handler city-lurker ((obj city-lurker) (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" + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'nav-mesh-kill) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) + (change-to *default-nav-mesh* obj) + #t + ) + ((= v1-0 'traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> obj root-override2 trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> obj root-override2 quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> obj root-override2 transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) + (when a0-10 + (change-to a0-10 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-17 (-> obj nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) + (when a1-5 + (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root-override2 trans)) + (let ((a0-14 (-> obj nav state)) + (v1-24 (-> obj controller turn-exit-point)) + ) + (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-14 target-post quad) (-> v1-24 quad)) + ) + 0 + ) + ) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root-override2 gspot-pos y)) + ) + ) + (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + ) + ) + ((= v1-0 'traffic-off) + #f + ) + ((= v1-0 'traffic-off-force) + #f + ) + ((= v1-0 'traffic-on) + #f + ) + ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(deftype city-meet-brutter-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + + +(define *city-meet-brutter-vehicle-info* + (new 'static 'inline-array city-meet-brutter-info 3 + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x 1161625.6 :y 73728.0 :z 3918233.5 :w 1.0) + :level 'ctypal + :end-pos (new 'static 'vector :x -451993.6 :y 32727.04 :z 2007572.5 :w 1.0) + ) + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x -743137.25 :y 73728.0 :z 1298800.6 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -494673.9 :y 32727.04 :z 2019041.2 :w 1.0) + ) + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x 401408.0 :y 73728.0 :z 3904471.0 :w 1.0) + :level 'ctypal + :end-pos (new 'static 'vector :x -509501.44 :y 32727.04 :z 1970462.8 :w 1.0) + ) + ) + ) + +(define *meet-brutter-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 207257.6 :y 65536.0 :z 2843975.8 :w 1.0) + (new 'static 'vector :x -1279795.2 :y 32768.0 :z 1825013.8 :w 1.0) + (new 'static 'vector :x 589414.4 :y 32768.0 :z 914636.8 :w 1.0) + (new 'static 'vector :x -457113.6 :y 32768.0 :z 1945559.0 :w 1.0) + ) + ) + +(set-subtask-hook! + *game-info* + 124 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'allow-continue #f 0 0) + (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> gp-0 object-type) (traffic-type cara)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (not (-> gp-0 proc)) + (format #t "traffic object spawn failed~%") + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 3) + (set! (-> self count) 3) + (dotimes (v1-20 4) + (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) + ) + (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-1 vec)) + (forward-up-nopitch->quaternion + (-> gp-1 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-1 params 0 behavior) (the-as uint 1)) + (set! (-> gp-1 params 0 id) (the-as uint 0)) + (set! (-> gp-1 params 0 nav-mesh) #f) + (set! (-> gp-1 params 0 nav-branch) #f) + (set! (-> gp-1 params 0 proc) #f) + (set! (-> gp-1 params 0 handle) (the-as handle #f)) + (set! (-> gp-1 params 0 user-data) (the-as uint 0)) + (set! (-> gp-1 params 0 flags) (the-as uint 2)) + (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 0 velocity)) + (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) + (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-1 params 1 behavior) (the-as uint 0)) + (set! (-> gp-1 params 1 id) (the-as uint 0)) + (set! (-> gp-1 params 1 nav-mesh) #f) + (set! (-> gp-1 params 1 nav-branch) #f) + (set! (-> gp-1 params 1 proc) #f) + (set! (-> gp-1 params 1 handle) (the-as handle #f)) + (set! (-> gp-1 params 1 user-data) (the-as uint 0)) + (set! (-> gp-1 params 1 flags) (the-as uint 1)) + (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 1 velocity)) + (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) + (countdown (s5-1 (-> self max-count)) + (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) + (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) + (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) + ) + ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) + (when s3-0 + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (the-as uint 124)) + (set! (-> s3-0 index) (the-as uint s5-1)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-1) (process->handle s3-0)) + (set! (-> self data-int32 s5-1) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) + ) + ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) + ) + ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) + ) + ) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self data-int32 16) 0) + (set! (-> self data-int32 17) 0) + (set! (-> self data-int32 17) (rand-vu-int-count 4)) + (set! (-> self data-int32 18) (rand-vu-int-count 4)) + (change-parent self *traffic-manager*) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 124 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(set-subtask-hook! + *game-info* + 124 + 6 + (the-as + (function object) + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (let ((gp-0 arg0)) + (cond + ((= (-> self data-int32 (-> gp-0 index)) -1) + (+! (-> self data-int32 (-> gp-0 index)) 1) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (let ((v1-14 (-> self data-int32 16))) + (cond + ((zero? v1-14) + (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 1) + (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 2) + (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (+! (-> self data-int32 16) 1) + ) + ((= (-> self data-int32 (-> gp-0 index)) 1) + ) + ) + (change-parent gp-0 self) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 124 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (v1-163 float) (v1-205 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((v1-2 0) + (gp-0 0) + ) + (dotimes (a0-1 (-> self max-count)) + (let ((a1-3 (handle->process (-> self slave a0-1)))) + (when (-> (the-as city-lurker a1-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a0-1) 3) + ) + (if (and (logtest? (focus-status pilot) (-> (the-as city-lurker a1-3) focus-status)) + (!= (-> self data-int32 a0-1) -1) + ) + (+! v1-2 1) + ) + ) + ) + (cond + ((zero? v1-2) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-15 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-15) task-done?)) + (set! (-> self minimap s5-0) + (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) + ) + ) + ) + ) + ) + (when (-> self minimap 3) + (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) + (set! (-> self minimap 3) #f) + ) + ) + (else + (dotimes (v1-30 (-> self max-count)) + (when (-> self minimap v1-30) + (when (-> self minimap v1-30) + (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-30) #f) + ) + ) + ) + (if (not (-> self minimap 3)) + (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) + ) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-1 (zero? (logand (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-1) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) + ) + (when (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (the-as uint 2)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) + (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) + ) + ) + ) + ) + ) + ) + (else + (if (not (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive))) + (send-event (the-as paddywagon s5-1) 'traffic-off-force) + ) + ) + ) + ) + ) + ) + (let ((gp-2 #f)) + (dotimes (v1-100 (-> self max-count)) + (if (= (-> self data-int32 v1-100) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-2 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-2)))) + (cond + ((= (-> self data-int32 s5-2) -1) + (when s4-2 + (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-2)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (the-as uint 0)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) + ) + ) + ) + ) + ((zero? (-> self data-int32 s5-2)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) + ) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-73 *target*)) + (when (and a0-73 (logtest? (focus-status pilot) (-> a0-73 focus-status))) + (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) + (when s3-3 + (cond + ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (handle->process (-> (the-as city-lurker s4-2) vehicle)) + ) + (+! (-> self data-int32 s5-2) 1) + ) + (else + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 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-163 vf1) + (let ((f0-2 v1-163) + (f1-0 32768.0) + ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-2) 1) + (when (the-as city-lurker s4-2) + (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-4 (-> self data-vector 3)) + (s2-1 (handle->process (-> *target* pilot vehicle))) + ) + (cond + ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (when (and s2-1 + (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) + (f1-6 114688.0) + ) + (< f0-4 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 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-205 vf1) + (let ((f0-5 v1-205) + (f1-9 421888.0) + ) + (< f0-5 (* f1-9 f1-9)) + ) + ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) + (let ((v1-214 (-> self data-int32 17))) + (cond + ((zero? v1-214) + (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 1) + (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 2) + (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (+! (-> self data-int32 17) 1) + ) + ) + (else + (set! (-> self data-int32 s5-2) 0) + 0 + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-2) 2) + (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-116 (if (type? s3-8 entity-nav-mesh) + s3-8 + ) + ) + ) + (if a0-116 + (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 124 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) + ) + +(set-subtask-hook! *game-info* 124 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +(set-subtask-hook! + *game-info* + 124 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) + (none) + ) + ) + ) + +(deftype city-save-lurkers-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + (pipe-name string :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + + +(define *city-save-lurkers-pipe-info* + (new 'static 'boxed-array :type city-save-lurkers-info + (new 'static 'city-save-lurkers-info + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + ) + ) + +(define *city-save-lurkers-vehicle-info* + (new 'static 'inline-array city-save-lurkers-info 6 + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -821739.5 :y 71843.84 :z 1250508.8 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -884162.56 :y 71720.96 :z 281763.84 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -189071.36 :y 72540.16 :z 4100874.2 :w 1.0) + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -806133.75 :y 71720.96 :z 4597432.5 :w 1.0) + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -152289.28 :y 71884.8 :z -637419.5 :w 1.0) + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -957153.25 :y 70533.12 :z -1215078.4 :w 1.0) + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + ) + ) + +(define *save-lurkers-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 207257.6 :y 65536.0 :z 2843975.8 :w 1.0) + (new 'static 'vector :x -1279795.2 :y 32768.0 :z 1825013.8 :w 1.0) + (new 'static 'vector :x 589414.4 :y 32768.0 :z 914636.8 :w 1.0) + (new 'static 'vector :x -457113.6 :y 32768.0 :z 1945559.0 :w 1.0) + ) + ) + +(set-subtask-hook! + *game-info* + 207 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (dotimes (v1-3 8) + (set! (-> self minimap v1-3) #f) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 6) + (set! (-> self count) 6) + (dotimes (v1-8 4) + (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) + ) + (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-0 vec)) + (forward-up-nopitch->quaternion + (-> gp-0 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-0 params 0 behavior) (the-as uint 1)) + (set! (-> gp-0 params 0 id) (the-as uint 0)) + (set! (-> gp-0 params 0 nav-mesh) #f) + (set! (-> gp-0 params 0 nav-branch) #f) + (set! (-> gp-0 params 0 proc) #f) + (set! (-> gp-0 params 0 handle) (the-as handle #f)) + (set! (-> gp-0 params 0 user-data) (the-as uint 0)) + (set! (-> gp-0 params 0 flags) (the-as uint 2)) + (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 0 velocity)) + (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) + (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-0 params 1 behavior) (the-as uint 8)) + (set! (-> gp-0 params 1 id) (the-as uint 0)) + (set! (-> gp-0 params 1 nav-mesh) #f) + (set! (-> gp-0 params 1 nav-branch) #f) + (set! (-> gp-0 params 1 proc) #f) + (set! (-> gp-0 params 1 handle) (the-as handle #f)) + (set! (-> gp-0 params 1 user-data) (the-as uint 0)) + (set! (-> gp-0 params 1 flags) (the-as uint 1)) + (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 1 velocity)) + (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) + (countdown (s5-0 (-> self max-count)) + (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) + (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) + (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) + ) + ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) + (when s3-0 + (set! (-> s3-0 jump-in-pipe?) #t) + (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (the-as uint 207)) + (set! (-> s3-0 index) (the-as uint s5-0)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-0) (process->handle s3-0)) + (set! (-> self data-int32 s5-0) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) + ) + ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) + ) + ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) + ) + ) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self arrow) (the-as handle #f)) + (change-parent self *traffic-manager*) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 207 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(set-subtask-hook! + *game-info* + 207 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (cond + ((= (-> self data-int32 (-> arg0 index)) -1) + (+! (-> self data-int32 (-> arg0 index)) 1) + ) + ((= (-> self data-int32 (-> arg0 index)) 1) + ) + ) + (change-parent arg0 self) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 207 + 2 + (lambda :behavior task-manager + () + (local-vars (v1-178 float) (v1-231 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((a0-1 0) + (gp-0 0) + ) + (let ((v1-2 0)) + (dotimes (a1-0 (-> self max-count)) + (let ((a2-3 (handle->process (-> self slave a1-0)))) + (when (-> (the-as city-lurker a2-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a1-0) 3) + ) + (when (and (logtest? (focus-status pilot) (-> (the-as city-lurker a2-3) focus-status)) + (!= (-> self data-int32 a1-0) -1) + ) + (set! v1-2 a1-0) + (+! a0-1 1) + ) + ) + ) + (cond + ((zero? a0-1) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-4 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-4) task-done?)) + (set! (-> self minimap s5-0) (add-icon! *minimap* a1-4 (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + ) + ) + ) + ) + (when (-> self arrow) + (when (handle->process (-> self arrow)) + (send-event (handle->process (-> self arrow)) 'die) + (set! (-> self arrow) (the-as handle #f)) + ) + ) + ) + (else + (dotimes (a0-18 (-> self max-count)) + (when (-> self minimap a0-18) + (logior! (-> self minimap a0-18 flags) (minimap-flag fade-out)) + (set! (-> self minimap a0-18) #f) + ) + ) + (when (not (-> self arrow)) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (let ((a0-23 (-> self slave v1-2 process 0))) + (set! (-> s5-1 pos quad) (-> (the-as city-lurker a0-23) end-pos quad)) + ) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags)) + (set! (-> s5-1 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 (the-as task-arrow self)))) + ) + ) + ) + ) + ) + (dotimes (v1-45 (-> self max-count)) + (when (and (-> (the-as city-lurker (-> self slave v1-45 process 0)) task-done?) (-> self minimap v1-45)) + (logior! (-> self minimap v1-45 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-45) #f) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-2 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-2 (zero? (logand (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-2) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-2) current-level)) 'active) + ) + (when (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (the-as uint 2)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-2) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-2) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-2) (-> (the-as paddywagon s5-2) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-2) s3-0 (the-as process-focusable s4-1)) + (logior! (-> (the-as process-focusable s4-1) focus-status) (focus-status pilot-riding)) + ) + ) + ) + ) + ) + ) + (else + (if (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive))) + (send-event (the-as paddywagon s5-2) 'traffic-off-force) + ) + ) + ) + ) + ) + ) + (let ((gp-2 #f)) + (dotimes (v1-111 (-> self max-count)) + (if (= (-> self data-int32 v1-111) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-3 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-3)))) + (cond + ((= (-> self data-int32 s5-3) -1) + (when s4-2 + (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-3)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (the-as uint 0)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) + ) + ) + ) + ) + ((zero? (-> self data-int32 s5-3)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) + ) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-95 *target*)) + (when (and a0-95 (logtest? (focus-status pilot) (-> a0-95 focus-status))) + (let ((s3-3 (handle->process (-> a0-95 pilot vehicle)))) + (when s3-3 + (cond + ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (handle->process (-> (the-as city-lurker s4-2) vehicle)) + ) + (+! (-> self data-int32 s5-3) 1) + ) + (else + (let ((v1-174 + (get-best-seat-for-vehicle (the-as vehicle s3-3) (-> (the-as vehicle s3-3) root-override-2 trans) 4 0) + ) + ) + (when (!= v1-174 -1) + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 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-178 vf1) + (let ((f0-2 v1-178) + (f1-0 32768.0) + ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-3) 1) + (when (the-as city-lurker s4-2) + (let ((f30-0 (the-as float #x7f800000))) + (dotimes (s3-4 (-> *city-save-lurkers-pipe-info* length)) + (let* ((s2-1 (-> *city-save-lurkers-pipe-info* s3-4)) + (f0-4 (vector-vector-xz-distance (-> s2-1 end-pos) (-> (the-as city-lurker s4-2) root-override2 trans))) + ) + (when (< f0-4 f30-0) + (set! f30-0 f0-4) + (set! (-> (the-as city-lurker s4-2) pipe-name) (-> s2-1 pipe-name)) + (set! (-> (the-as city-lurker s4-2) end-pos quad) (-> s2-1 end-pos quad)) + ) + ) + ) + ) + (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-5 (-> (the-as city-lurker s4-2) end-pos)) + (s2-2 (handle->process (-> *target* pilot vehicle))) + ) + (cond + ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (when (and s2-2 + (let ((f0-5 (vector-vector-distance-squared s3-5 (-> (the-as vehicle s2-2) root-override-2 trans))) + (f1-6 114688.0) + ) + (< f0-5 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-2) root-override-2 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-231 vf1) + (let ((f0-6 v1-231) + (f1-9 40960.0) + ) + (< f0-6 (* f1-9 f1-9)) + ) + ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-5) + ) + ) + (else + (set! (-> self data-int32 s5-3) 0) + 0 + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-3) 2) + (let* ((s3-6 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-134 (if (type? s3-6 entity-nav-mesh) + s3-6 + ) + ) + ) + (if a0-134 + (change-to (-> a0-134 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +(set-subtask-hook! + *game-info* + 207 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) + ) + +(set-subtask-hook! *game-info* 207 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +(set-subtask-hook! + *game-info* + 207 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 6) + (let ((a1-3 (handle->process (-> self slave a0-0)))) + (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) + (+! v1-2 1) + ) + ) + ) + (if (= v1-2 6) + (goto cfg-20) + ) + ) + (suspend) + 0 + ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) + (none) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc new file mode 100644 index 0000000000..2a8164eeb7 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc @@ -0,0 +1,3508 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 15 of type hud-lurker +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-lurker ((obj hud-lurker)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 16 of type hud-lurker +;; WARN: Return type mismatch int vs none. +(defmethod update-values hud-lurker ((obj hud-lurker)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-lurker +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-lurker ((obj hud-lurker)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-paddywagon paddy-wagon paddy-wagon-lod0-jg paddy-wagon-idle-ja + ((paddy-wagon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.4) + :shadow paddy-wagon-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *paddywagon-constants*, type rigid-body-vehicle-constants +(define *paddywagon-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.1 + :friction-factor 0.05 + :cm-offset-joint (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 3) (meters 7)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*paddywagon-constants* + :flags #xc + :object-type #x13 + :guard-type #x5 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 60.0 + :engine-intake-factor 1.5 + :brake-factor 3.5 + :turbo-boost-factor 1.0 + :max-xz-speed (meters 40) + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261824 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 5.0 + :steering-thruster-max-gain 4.0 + :steering-thruster-half-gain-speed (meters 15) + :tire-friction-factor 0.5 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000034877234 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.5 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :target-speed-offset (meters -2) + :turning-accel (meters 45) + :toughness-factor 1.0 + :damage-factor 6.0 + :camera-string-min-height (meters 4.5) + :camera-string-max-height (meters 4.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 12.5) + :camera-min-fov 15109.688 + :camera-max-fov 17476.268 + :camera-head-offset 8192.0 + :camera-foot-offset 4096.0 + :camera-normal-max-angle-offset 182.04445 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :seat-count 2 + :rider-stance #x1 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :y 9420.8 :z 2457.6 :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 819.2 :z -13107.2 :w (the-as float #x48000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0) + (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0) + ) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select #x8 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "car-glance-stn") + :impact-sound (static-sound-name "car-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.4) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15769.6 :y 4096.0 :z -15155.2 :w 1.0) + (new 'static 'vector :x -15769.6 :y 4096.0 :z -15155.2 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :z -2048.0 :w 1.0) + (new 'static 'vector :z -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 12288.0 :y 9216.0 :z -5734.4 :w 1.0) + (new 'static 'vector :x -12288.0 :y 9216.0 :z -5734.4 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 15564.8 :y 9216.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x -15564.8 :y 9216.0 :z -17203.2 :w 1.0) + ) + :lift-thruster-count 2 + :roll-thruster-count 2 + :steering-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 5734.4 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -9830.4 :w 1.0) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-control-point 6 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :normal (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point) + (new 'static 'vehicle-control-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :color-option-count 1 + :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + ) + ) + +;; definition of type paddywagon +(deftype paddywagon (vehicle-guard) + ((current-level symbol :offset-assert 1076) + ) + :heap-base #x3c0 + :method-count-assert 159 + :size-assert #x438 + :flag-assert #x9f03c00438 + ) + +;; definition for method 3 of type paddywagon +(defmethod inspect paddywagon ((obj paddywagon)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-guard inspect))) + (t9-0 obj) + ) + (format #t "~2Tcurrent-level: ~A~%" (-> obj current-level)) + (label cfg-4) + obj + ) + +;; definition for method 32 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod allocate-and-init-cshape paddywagon ((obj paddywagon)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 26624.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 8192.0 -14336.0 11468.8) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 12288.0 7372.8 -12288.0 8192.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) -12288.0 7372.8 -12288.0 8192.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 8192.0 0.0 6144.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 9011.2 7372.8 4915.2) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (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! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +;; definition of type pw-iter-seg +(deftype pw-iter-seg (structure) + ((self paddywagon :offset-assert 0) + (desired-dir vector :inline :offset-assert 16) + (score float :offset-assert 32) + (seg nav-segment :offset-assert 36) + (level symbol :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type pw-iter-seg +(defmethod inspect pw-iter-seg ((obj pw-iter-seg)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pw-iter-seg) + (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tdesired-dir: #~%" (-> obj desired-dir)) + (format #t "~1Tscore: ~f~%" (-> obj score)) + (format #t "~1Tseg: #~%" (-> obj seg)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (label cfg-4) + obj + ) + +;; definition for function pw-iter-seg-new-dir-level +;; INFO: Used lq/sq +;; WARN: Return type mismatch nav-segment vs none. +(defun pw-iter-seg-new-dir-level ((arg0 pw-iter-seg) (arg1 nav-segment)) + (-> arg0 self) + (let ((a1-1 (-> arg1 branch src-node)) + (v1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-2 quad) (-> a1-1 position quad)) + (set! (-> v1-2 w) 1.0) + (let ((a2-0 (-> arg1 branch dest-node)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a2-0 position quad)) + (set! (-> a0-4 w) 1.0) + (set! (-> v1-2 y) 0.0) + (set! (-> a0-4 y) 0.0) + (set! (-> v1-2 w) 1.0) + (set! (-> a0-4 w) 1.0) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) a0-4 v1-2))) + 0.0 + (vector-normalize! s4-1 1.0) + (let ((f0-8 (vector-dot s4-1 (-> arg0 desired-dir)))) + (when (and (< (-> arg0 score) f0-8) + (= (-> arg0 level) (-> arg1 branch src-node level)) + (= (-> arg0 level) (-> arg1 branch dest-node level)) + ) + (set! (-> arg0 score) f0-8) + (set! (-> arg0 seg) arg1) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function choose-next-branch-no-exit-level +;; INFO: Used lq/sq +(defun choose-next-branch-no-exit-level ((arg0 vehicle-controller) (arg1 paddywagon)) + (let ((gp-0 (the-as nav-branch #f))) + (let* ((s3-0 (-> arg0 branch dest-node)) + (s2-0 (-> s3-0 branch-count)) + ) + (b! (!= s2-0 1) cfg-7 :delay (empty-form)) + (let ((v1-4 (-> s3-0 branch-array 0))) + (if (and (!= (-> v1-4 dest-node id) #xffff) (= (-> s3-0 level) (-> v1-4 dest-node level))) + (set! gp-0 v1-4) + ) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-7) + (when (< 1 s2-0) + (let ((v1-6 (rand-vu-int-count s2-0)) + (a0-10 s2-0) + ) + (b! #t cfg-16 :delay (nop!)) + (label cfg-9) + (+! a0-10 -1) + (let ((a1-6 (-> s3-0 branch-array v1-6))) + (b! + (not (and (!= (-> a1-6 dest-node id) #xffff) (= (-> s3-0 level) (-> a1-6 dest-node level)))) + cfg-14 + :delay (empty-form) + ) + (set! gp-0 a1-6) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-14) + (+! v1-6 1) + (if (>= v1-6 s2-0) + (set! v1-6 0) + ) + (label cfg-16) + (b! (nonzero? a0-10) cfg-9 :delay (nop!)) + ) + ) + ) + (label cfg-18) + (let ((s3-1 4)) + (let ((f30-0 122880.0)) + (b! #t cfg-22 :delay (nop!)) + (label cfg-19) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'pw-iter-seg)) + ) + (let ((v1-10 + (vector-negate-in-place! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 root-override-2 quat))) + ) + ) + (set! (-> s1-0 quad) (-> arg1 root-override-2 trans quad)) + (set! (-> s1-0 w) f30-0) + (set! (-> s2-1 seg) #f) + (set! (-> s2-1 score) 0.0) + (set! (-> s2-1 level) (-> arg0 branch src-node level)) + (set! (-> s2-1 desired-dir quad) (-> v1-10 quad)) + ) + (vector-normalize! (-> s2-1 desired-dir) 1.0) + (set! (-> s2-1 self) arg1) + (callback-on-nav-segments-in-sphere + (-> arg1 controller traffic) + s1-0 + 0 + (the-as traffic-find-segment-struct s2-1) + (the-as (function traffic-find-segment-struct nav-segment none) pw-iter-seg-new-dir-level) + ) + (if (-> s2-1 seg) + (set! gp-0 (-> s2-1 seg branch)) + ) + ) + (format #t "new branch in level picked~%") + (+! s3-1 -1) + (set! f30-0 (+ 81920.0 f30-0)) + ) + (label cfg-22) + (b! (and (nonzero? s3-1) (not gp-0)) cfg-19 :delay (nop!)) + ) + (if (not gp-0) + (format *stdcon* "no branch~%") + ) + gp-0 + ) + ) + +;; definition for method 33 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod init-skel-and-rigid-body paddywagon ((obj paddywagon)) + (with-pp + (set! (-> pp level) (level-get *level* 'lmeetbrt)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-paddywagon" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (alloc-and-init-rigid-body-control obj *paddywagon-constants*) + (set! (-> obj draw lod-set lod 0 dist) 819200.0) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> obj flags))) + ) + (set! (-> obj controller choose-branch-callback) choose-next-branch-no-exit-level) + 0 + (none) + ) + ) + +;; definition for method 120 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-120 paddywagon ((obj paddywagon)) + (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) + (t9-0 obj) + ) + (if (logtest? (-> obj controller flags) (vehicle-controller-flag attached)) + (set! (-> obj current-level) (-> obj controller branch dest-node level)) + (set! (-> obj current-level) #f) + ) + (vehicle-method-119 obj) + 0 + (none) + ) + +;; definition for method 128 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-128 paddywagon ((obj paddywagon)) + (let ((t9-0 (method-of-type vehicle vehicle-method-128))) + (t9-0 obj) + ) + (logior! (-> obj flags) (rigid-body-object-flag persistent)) + 0 + (none) + ) + +;; definition for method 127 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-127 paddywagon ((obj paddywagon)) + ((method-of-type vehicle vehicle-method-127) obj) + 0 + (none) + ) + +;; definition for method 129 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-129 paddywagon ((obj paddywagon)) + ((method-of-type vehicle vehicle-method-129) obj) + 0 + (none) + ) + +;; definition for method 134 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-134 paddywagon ((obj paddywagon) (arg0 process)) + "Stubbed" + (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (set! (-> obj controller target-speed-offset) 81920.0) + (set! (-> obj pursuit-target) (process->handle arg0)) + (set! (-> obj flags) (logior (rigid-body-object-flag alert) (-> obj flags))) + (if (task-node-open? (game-task-node city-save-lurkers-save-lurkers)) + (vehicle-method-111 obj 1 (the-as target arg0)) + (vehicle-method-111 obj 2 (the-as target arg0)) + ) + (go (method-of-object obj hostile)) + 0 + (none) + ) + +;; definition for method 108 of type paddywagon +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-108 paddywagon ((obj paddywagon)) + (set! (-> obj flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) + ) + (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (paddywagon) + :virtual #t + :enter (behavior () + (vehicle-method-107 self) + (let ((t9-1 (-> (method-of-type vehicle-guard active) enter))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (paddywagon) + :virtual #t + :enter (behavior () + '() + (none) + ) + :trans (the-as (function none :behavior paddywagon) #f) + :code (the-as (function none :behavior paddywagon) sleep-code) + :post (behavior () + (vehicle-guard-method-158 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (paddywagon) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-city-lurker babak babak-lod0-jg babak-idle-ja + ((babak-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow babak-shadow-mg + ) + +;; definition for symbol *city-lurker-global-info*, type civilian-global-info +(define *city-lurker-global-info* + (new 'static 'civilian-global-info + :knocked (new 'static 'array int32 2 6 6) + :knocked-land (new 'static 'array int32 2 7 7) + :yellow-hit-anim (new 'static 'inline-array civilian-anim-info 1 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + ) + :blue-hit-anim (new 'static 'inline-array civilian-anim-info 3 + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + (new 'static 'civilian-anim-info :anim-index (new 'static 'array int32 2 6 6)) + ) + :anim-cover-head-start 3 + :anim-cover-head-loop 3 + :anim-cover-head-end 3 + :car-stance-anim 10 + :get-in-car-anim 8 + :get-on-bike-anim 16 + :seat-flag #x4 + ) + ) + +;; definition for symbol *city-lurker-nav-enemy-info*, type nav-enemy-info +(define *city-lurker-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 6 + :knocked-land-anim 7 + :die-anim 3 + :die-falling-anim 3 + :victory-anim 3 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :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 61440.0 + :knocked-soft-vxz-hi 102400.0 + :knocked-soft-vy-lo 40960.0 + :knocked-soft-vy-hi 81920.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 204800.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 163840.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 20480.0 + :knocked-yellow-vxz-hi 40960.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 65536.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 49152.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 65536.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 #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim 3 + :run-anim 5 + :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 1) + :walk-turning-acceleration (meters 30) + :maximum-rotation-rate (degrees 720.0) + :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 + ) + ) + +;; failed to figure out what this is: +(set! (-> *city-lurker-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type city-lurker +(deftype city-lurker (civilian) + ((nav-mesh-aid uint32 :offset-assert 1060) + (index uint32 :offset-assert 1064) + (left-right-interp float :offset-assert 1068) + (front-back-interp float :offset-assert 1072) + (v-speed vector :inline :offset-assert 1088) + (end-pos vector :inline :offset-assert 1104) + (task-done? symbol :offset-assert 1120) + (task-node uint16 :offset-assert 1124) + (jump-in-pipe? symbol :offset-assert 1128) + (pipe-name string :offset-assert 1132) + (coming-from-pw symbol :offset-assert 1136) + ) + :heap-base #x400 + :method-count-assert 221 + :size-assert #x474 + :flag-assert #xdd04000474 + (:methods + (go-at-end () _type_ :state 218) + (go-at-pipe () _type_ :state 219) + (wait-at-end () _type_ :state 220) + ) + ) + +;; definition for method 3 of type city-lurker +(defmethod inspect city-lurker ((obj city-lurker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type civilian inspect))) + (t9-0 obj) + ) + (format #t "~2Tnav-mesh-aid: ~D~%" (-> obj nav-mesh-aid)) + (format #t "~2Tindex: ~D~%" (-> obj index)) + (format #t "~2Tleft-right-interp: ~f~%" (-> obj left-right-interp)) + (format #t "~2Tfront-back-interp: ~f~%" (-> obj front-back-interp)) + (format #t "~2Tv-speed: #~%" (-> obj v-speed)) + (format #t "~2Tend-pos: #~%" (-> obj end-pos)) + (format #t "~2Ttask-done?: ~A~%" (-> obj task-done?)) + (format #t "~2Ttask-node: ~D~%" (-> obj task-node)) + (format #t "~2Tjump-in-pipe?: ~A~%" (-> obj jump-in-pipe?)) + (format #t "~2Tpipe-name: ~A~%" (-> obj pipe-name)) + (format #t "~2Tcoming-from-pw: ~A~%" (-> obj coming-from-pw)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate knocked (city-lurker) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (-> (method-of-type civilian knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((s5-0 (find-nearest-nav-mesh (-> self root-override2 trans) (the-as float #x7f800000))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (if s5-0 + (set! (-> self nav-mesh-aid) (-> s5-0 entity aid)) + ) + (change-to s5-0 self) + (if (not (-> self nav)) + (go-inactive self) + ) + (set! (-> self nav-mesh-aid) (-> s5-0 entity aid)) + (let ((v1-17 (-> self nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (do-navigation-to-destination (-> self nav state) (-> self root-override2 trans)) + (cond + ((-> self coming-from-pw) + (let ((s5-1 (-> self nav)) + (s4-0 (method-of-type nav-control cloest-point-on-mesh)) + (s3-0 gp-0) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (let ((s1-0 (-> self root-override2 trans))) + (let ((v1-27 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)))) + (let ((a0-7 20480.0)) + (.mov vf7 a0-7) + ) + (.lvf vf5 (&-> v1-27 quad)) + ) + (.lvf vf4 (&-> s1-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-0 quad) vf6) + (s4-0 s5-1 s3-0 s2-0 (the-as nav-poly #f)) + ) + (set! (-> self root-override2 transv x) (- (-> gp-0 x) (-> self root-override2 trans x))) + (set! (-> self root-override2 transv y) 40960.0) + (set! (-> self root-override2 transv z) (- (-> gp-0 z) (-> self root-override2 trans z))) + (set! (-> self coming-from-pw) #f) + ) + (else + (cloest-point-on-mesh (-> self nav) gp-0 (-> self root-override2 trans) (the-as nav-poly #f)) + (when (< 4096.0 (vector-vector-xz-distance gp-0 (-> self root-override2 trans))) + (set! (-> self root-override2 transv x) (- (-> gp-0 x) (-> self root-override2 trans x))) + (set! (-> self root-override2 transv y) 40960.0) + (set! (-> self root-override2 transv z) (- (-> gp-0 z) (-> self root-override2 trans z))) + ) + ) + ) + ) + (set! (-> self gnd-height) (-> self root-override2 gspot-pos y)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'on-ground) + (let ((t9-9 send-event-function) + (v1-55 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-9 + (handle->process (if (-> v1-55 info) + (-> v1-55 info manager) + (the-as handle #f) + ) + ) + a1-7 + ) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (vector-y-quaternion! s5-2 (-> self root-override2 quat)) + (vector-normalize! s5-2 1.0) + (quaternion-from-two-vectors! gp-1 s5-2 *up-vector*) + (quaternion*! (-> self root-override2 quat) gp-1 (-> self root-override2 quat)) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(defstate move-to-vehicle (city-lurker) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate board-vehicle (city-lurker) + :virtual #t + :code (behavior () + (local-vars (sv-128 float) (sv-144 float) (sv-160 float)) + (let ((gp-0 0)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (set! gp-0 (-> self info get-on-bike-anim)) + ) + ((14 15 16) + (set! gp-0 (-> self info get-in-car-anim)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! min) + (let ((f30-0 0.0)) + (while (< f30-0 1.0) + (ja :num-func num-func-identity + :frame-num (lerp-scale 0.0 2.0 (+ (* -2.0 f30-0 f30-0 f30-0) (* 3.0 f30-0 f30-0)) 0.0 1.0) + ) + (suspend) + (+! f30-0 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self root-override2 trans quad)) + (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override2 quat)))) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 8.0 0)) + :frame-num (ja-aframe 2.0 0) + ) + (until (ja-done? 0) + (let ((s1-0 (handle->process (-> self vehicle))) + (s0-0 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + ) + (if (not s1-0) + (go-virtual wait-for-ride) + ) + (quaternion-copy! s2-0 (-> (the-as vehicle s1-0) root-override-2 quat)) + (compute-seat-position (the-as vehicle s1-0) s0-0 (-> self seat)) + (vector-! s3-1 s0-0 s5-2) + (let ((s1-1 lerp-scale) + (s0-1 0.0) + ) + (set! sv-128 (the-as float 1.0)) + (set! sv-144 (ja-aframe-num 0)) + (set! sv-160 (ja-aframe 2.0 0)) + (let* ((t0-1 (ja-aframe 8.0 0)) + (f30-1 (s1-1 s0-1 sv-128 sv-144 sv-160 t0-1)) + ) + (quaternion-slerp! (-> self root-override2 quat) s4-0 s2-0 f30-1) + (vector+float*! (-> self root-override2 trans) s5-2 s3-1 f30-1) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0))) + ) + ) + ) + (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override2 quat)) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 10.0 0)) + :frame-num (ja-aframe 8.0 0) + ) + ) + (until (ja-done? 0) + (let ((s5-4 (handle->process (-> self vehicle))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (if (not s5-4) + (go-virtual wait-for-ride) + ) + (quaternion-copy! gp-1 (-> (the-as vehicle s5-4) root-override-2 quat)) + (compute-seat-position (the-as vehicle s5-4) (-> self root-override2 trans) (-> self seat)) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) (ja-aframe 8.0 0) (ja-aframe 10.0 0)) + (quaternion-copy! (-> self root-override2 quat) gp-1) + ) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) + (go-virtual ride) + (none) + ) + ) + +;; definition for method 26 of type city-lurker +(defmethod get-inv-mass city-lurker ((obj city-lurker)) + 0.25 + ) + +;; failed to figure out what this is: +(defstate in-ditch (city-lurker) + :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 + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate ride (city-lurker) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type civilian ride) exit))) + (if t9-0 + (t9-0) + ) + ) + (let* ((v1-5 (-> self skel float-channels)) + (a0-2 (if (= v1-5 1) + (-> self skel channel (-> self skel active-channels)) + (the-as joint-control-channel #f) + ) + ) + ) + (if a0-2 + (joint-channel-float-delete! a0-2) + ) + ) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (civilian-method-217 self a1-0) + ) + (let ((t9-1 (-> (method-of-type civilian ride) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (handle->process (-> self vehicle)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 3 (seconds 0.2)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (ja :group! (-> self draw art-group data 12)) + (ja :chan 1 :group! (-> self draw art-group data 13)) + (ja :chan 2 :group! (-> self draw art-group data 14)) + ) + ((14 15 16) + (ja :group! (-> self draw art-group data 9)) + (ja :chan 1 :group! (-> self draw art-group data 10)) + (ja :chan 2 :group! (-> self draw art-group data 11)) + ) + ) + (let ((v1-26 (ja-channel-float! (the-as art-joint-anim (-> self draw art-group data 15)) 0.0 0.0 0.0))) + (when v1-26 + (set! (-> self skel interp-select 0) (the-as int (the-as uint #x8100002000))) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-26 param 0) 1.0) + (set! (-> v1-26 num-func) num-func-loop!) + ) + ) + (until #f + (let ((v1-28 (handle->process (-> self vehicle)))) + (when v1-28 + (let* ((v1-30 (-> (the-as vehicle v1-28) rbody)) + (a1-10 (-> self root-override2 trans)) + (a2-1 (new 'stack-no-clear 'vector)) + (gp-0 (rigid-body-method-22 (-> v1-30 state) a1-10 a2-1)) + ) + (vector-inv-orient-by-quat! gp-0 gp-0 (-> self root-override2 quat)) + (seek! (-> self v-speed x) (-> gp-0 x) (* 81920.0 (-> self clock seconds-per-frame))) + (seek! (-> self v-speed z) (-> gp-0 z) (* 49152.0 (-> self clock seconds-per-frame))) + (set! (-> self left-right-interp) + (fmax + 0.0 + (fmin + 2.0 + (+ (-> self left-right-interp) + (* 8.0 + (- (lerp-scale 0.0 2.0 (-> gp-0 x) -20480.0 20480.0) (-> self left-right-interp)) + (-> self clock seconds-per-frame) + ) + ) + ) + ) + ) + (set! (-> self front-back-interp) + (fmax + 0.0 + (fmin + 2.0 + (+ (-> self front-back-interp) + (* 8.0 + (- (lerp-scale 0.0 2.0 (- (-> self v-speed z) (-> gp-0 z)) -16384.0 16384.0) (-> self front-back-interp)) + (-> self clock seconds-per-frame) + ) + ) + ) + ) + ) + (let ((s5-0 (-> self skel root-channel 0))) + (let ((f0-29 (lerp-scale 0.0 1.0 (-> self front-back-interp) 1.0 0.0))) + (set! (-> s5-0 frame-interp 1) f0-29) + (set! (-> s5-0 frame-interp 0) f0-29) + ) + (set! (-> s5-0 num-func) num-func-identity) + (set! (-> s5-0 frame-num) (ja-aframe (-> self left-right-interp) 0)) + ) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-36 (if (>= 1.0 (-> self front-back-interp)) + (-> self front-back-interp) + (- 2.0 (-> self front-back-interp)) + ) + ) + ) + (set! (-> s5-1 frame-interp 1) f0-36) + (set! (-> s5-1 frame-interp 0) f0-36) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe (-> self left-right-interp) 1)) + ) + (let ((s5-2 (-> self skel root-channel 2))) + (let ((f0-40 (lerp-scale 0.0 1.0 (-> self front-back-interp) 1.0 2.0))) + (set! (-> s5-2 frame-interp 1) f0-40) + (set! (-> s5-2 frame-interp 0) f0-40) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe (-> self left-right-interp) 2)) + ) + (let* ((v1-59 (-> self skel float-channels)) + (s5-3 (if (= v1-59 1) + (-> self skel channel (-> self skel active-channels)) + (the-as joint-control-channel #f) + ) + ) + ) + (when s5-3 + (set! (-> s5-3 frame-interp 0) 0.0) + (set! (-> s5-3 frame-interp 1) + (lerp-scale 0.0 1.0 (sqrtf (+ (* (-> gp-0 x) (-> gp-0 x)) (* (-> gp-0 z) (-> gp-0 z)))) 0.0 122880.0) + ) + (set! (-> s5-3 param 0) 2.0) + ) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate exit-vehicle (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + (let ((a0-2 (find-nearest-nav-mesh (-> self root-override2 trans) (the-as float #x7f800000)))) + (if a0-2 + (set! (-> self nav-mesh-aid) (-> a0-2 entity aid)) + ) + (change-to a0-2 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-override2 quat))) + ) + (let ((a0-9 (-> self nav state)) + (v1-17 (-> self controller turn-exit-point)) + ) + (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-9 target-post quad) (-> v1-17 quad)) + ) + 0 + (citizen-nav-init! self) + (set! (-> self gnd-height) (-> self root-override2 gspot-pos y)) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self focus-status) (logior (focus-status pilot-riding pilot) (-> self focus-status))) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-31 (-> self root-override2 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 + (none) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((t9-0 (-> (method-of-type civilian exit-vehicle) exit))) + (if t9-0 + (t9-0) + ) + ) + (none) + ) + :code (behavior ((arg0 object) (arg1 object) (arg2 int) (arg3 symbol) (arg4 event-message-block)) + (local-vars (sv-128 float)) + (let ((gp-0 0)) + (case (-> (the-as vehicle (handle->process (-> self vehicle))) info-override object-type) + ((11 12 13) + (set! gp-0 (-> self info get-on-bike-anim)) + ) + ((14 15 16) + (set! gp-0 (-> self info get-in-car-anim)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 8.0 0) 0.6666667) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (let ((s5-1 (handle->process (-> self vehicle)))) + (new 'stack-no-clear 'vector) + (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle s5-1) root-override-2 quat)) + (compute-seat-position (the-as vehicle s5-1) (-> self root-override2 trans) (-> self seat)) + ) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.6666667)) + ) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (civilian-method-217 self s5-3)) + (let ((s3-0 (handle->process (-> self vehicle)))) + (new 'stack-no-clear 'vector) + (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle s3-0) root-override-2 quat)) + (compute-seat-position (the-as vehicle s3-0) (-> self root-override2 trans) (-> self seat)) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (go-virtual ride) + ) + (suspend) + ) + (remove-rider (the-as vehicle (handle->process (-> self vehicle))) self) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (quaternion-copy! s4-0 (-> self root-override2 quat)) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) + :num! (seek! (ja-aframe 2.0 0) 0.6666667) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (let ((s3-1 (handle->process (-> self vehicle))) + (s2-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (s4-2 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s4-2 (-> (the-as vehicle s3-1) root-override-2 quat)) + (compute-seat-position (the-as vehicle s3-1) s2-0 (-> self seat)) + (vector-! gp-1 s2-0 s5-3) + (let ((s3-2 lerp-scale) + (s2-1 0.0) + (s1-0 1.0) + (s0-0 (ja-aframe-num 0)) + ) + (set! sv-128 (ja-aframe 8.0 0)) + (let* ((t0-1 (ja-aframe 2.0 0)) + (f0-9 (s3-2 s2-1 s1-0 s0-0 sv-128 t0-1)) + (f30-0 (- 1.0 f0-9)) + ) + (quaternion-copy! (-> self root-override2 quat) s4-2) + (vector+float*! (-> self root-override2 trans) s5-3 gp-1 f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! (ja-aframe 2.0 0) 0.6666667)) + ) + ) + ) + (let ((v1-83 (-> self root-override2 root-prim))) + (set! (-> v1-83 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-83 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (go-virtual wait-for-ride) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-ride (city-lurker) + :virtual #t + :enter (behavior () + (when (-> self task-done?) + (if (-> self jump-in-pipe?) + (go-virtual go-at-pipe) + (go-virtual go-at-end) + ) + ) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-15 (-> self nav))) + (set! (-> v1-15 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-17 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-17 enemy-flags))) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-17 enemy-flags)))) + ) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-17 enemy-flags)))) + (set! (-> v1-17 nav callback-info) (-> v1-17 enemy-info-override callback-info)) + ) + 0 + (let ((v1-20 self)) + (set! (-> v1-20 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-20 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type civilian wait-for-ride) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 163840.0) + (if (-> self jump-in-pipe?) + (go-virtual go-at-pipe) + (go-virtual go-at-end) + ) + ) + (none) + ) + :code (behavior () + (until #f + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override run-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override run-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (when (or (< 245760.0 (vector-vector-distance (-> self root-override2 trans) (target-pos 0))) + (< (vector-vector-distance (-> self root-override2 trans) (target-pos 0)) 24576.0) + ) + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 target-speed) 0.0) + ) + 0 + (let ((v1-39 self)) + (set! (-> v1-39 enemy-flags) (the-as enemy-flag (logclear (-> v1-39 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-39 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-42 self)) + (set! (-> v1-42 enemy-flags) (the-as enemy-flag (logclear (-> v1-42 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + #t + (goto cfg-13) + ) + ) + #f + (label cfg-13) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (when (and (< (vector-vector-distance (-> self root-override2 trans) (target-pos 0)) 245760.0) + (< 32768.0 (vector-vector-distance (-> self root-override2 trans) (target-pos 0))) + ) + (nav-enemy-method-166 self) + (let ((v1-87 (-> self nav))) + (set! (-> v1-87 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-89 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-89 enemy-flags))) + (set! (-> v1-89 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-89 enemy-flags)))) + ) + (set! (-> v1-89 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-89 enemy-flags)))) + (set! (-> v1-89 nav callback-info) (-> v1-89 enemy-info-override callback-info)) + ) + 0 + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-92 enemy-flags)))) + ) + 0 + #t + (goto cfg-28) + ) + ) + #f + (label cfg-28) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-1 (target-pos 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate go-at-end (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info-override callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-11 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (when (and (-> self jump-in-pipe?) + (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 24576.0) + ) + (logclear! (-> self flags) (citizen-flag persistent)) + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'task-done) + (let ((t9-1 send-event-function) + (v1-15 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-1 + (handle->process (if (-> v1-15 info) + (-> v1-15 info manager) + (the-as handle #f) + ) + ) + a1-1 + ) + ) + ) + ) + (let ((v1-22 (-> self root-override2 root-prim))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) + (send-event self 'jump 0 (-> self end-pos)) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (logtest? (-> self nav state flags) (nav-state-flag at-target)) + ) + (go-virtual wait-at-end) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self end-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate go-at-pipe (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (nav-enemy-method-166 self) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) + ) + 0 + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info-override callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-11 enemy-flags)))) + ) + 0 + (set! (-> self vehicle) (the-as handle #f)) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack 'sphere))) + (set! (-> gp-0 quad) (-> self end-pos quad)) + (set! (-> gp-0 r) 12288.0) + (when (and (-> self jump-in-pipe?) + (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self end-pos)) 28672.0) + (not (add-root-sphere-to-hash! (-> self nav) gp-0 38)) + ) + (logclear! (-> self flags) (citizen-flag persistent)) + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'task-done) + (let ((t9-3 send-event-function) + (v1-20 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-3 + (handle->process (if (-> v1-20 info) + (-> v1-20 info manager) + (the-as handle #f) + ) + ) + a1-3 + ) + ) + ) + ) + (let ((v1-27 (-> self root-override2 root-prim))) + (set! (-> v1-27 prim-core collide-as) (collide-spec)) + (set! (-> v1-27 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) + (send-event self 'jump 0 (-> self end-pos)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info-override run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (get-rand-float-range self 0.45 0.65))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self end-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-176 self) + (none) + ) + ) + +;; definition for method 86 of type city-lurker +(defmethod enemy-method-86 city-lurker ((obj city-lurker)) + (let ((gp-0 (-> obj root-override2))) + (when (< (-> gp-0 transv y) 0.0) + (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> obj end-pos y))) (-> obj jump-in-pipe?)) + (send-event (process-by-name (-> obj pipe-name) *active-pool*) 'spin) + (set! (-> obj jump-in-pipe?) #f) + ) + (>= (-> obj end-pos y) (-> gp-0 trans y)) + ) + ) + ) + +;; definition for method 93 of type city-lurker +;; WARN: Return type mismatch object vs none. +(defmethod enemy-method-93 city-lurker ((obj city-lurker)) + (go (method-of-object obj inactive)) + (none) + ) + +;; definition for method 89 of type city-lurker +(defmethod enemy-method-89 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + #f + ) + +;; definition for method 87 of type city-lurker +(defmethod enemy-method-87 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + (let ((a0-1 (-> obj skel root-channel 0))) + (set! (-> a0-1 param 0) 1.0) + (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> obj skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (set! (-> s5-0 param 0) (ja-aframe 6.0 0)) + (set! (-> s5-0 param 1) 0.5) + (set! (-> s5-0 frame-num) (ja-aframe 0.0 0)) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + ) + #t + ) + +;; definition for method 88 of type city-lurker +(defmethod enemy-method-88 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) + #f + ) + +;; failed to figure out what this is: +(defstate wait-at-end (city-lurker) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior city-lurker) enemy-event-handler) + :enter (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (when (not (-> self task-done?)) + (set! (-> self task-done?) #t) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'task-done) + (let ((t9-0 send-event-function) + (v1-16 (-> *game-info* sub-task-list (-> self task-node))) + ) + (t9-0 + (handle->process (if (-> v1-16 info) + (-> v1-16 info manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + ) + (none) + ) + :trans (behavior () + '() + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim))) + frames + num-frames + ) + -1 + ) + ) + 0.1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + ) + #f + (none) + ) + :post (behavior () + (nav-enemy-simple-post) + (none) + ) + ) + +;; definition for method 60 of type city-lurker +(defmethod coin-flip? city-lurker ((obj city-lurker)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +;; definition for method 56 of type city-lurker +(defmethod damage-amount-from-attack city-lurker ((obj city-lurker) (arg0 process) (arg1 event-message-block)) + "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" + 0 + ) + +;; failed to figure out what this is: +(defstate inactive (city-lurker) + :virtual #t + :enter (behavior () + (format #t "city-lurker inactive~%") + (let ((t9-1 (-> (method-of-type civilian inactive) enter))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate active (city-lurker) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type civilian active) enter))) + (if t9-0 + (t9-0) + ) + ) + (format #t "city-lurker active~%") + (none) + ) + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-front (city-lurker) + :virtual #t + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate get-up-back (city-lurker) + :virtual #t + :code (behavior () + (go-virtual wait-for-ride) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (city-lurker) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (enemy-event-handler proc arg1 event-type event) + ) + (else + (enemy-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (citizen-init! self) + (set! (-> self hit-points) 100) + (logior! (-> self flags) (citizen-flag persistent)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-8 (-> self root-override2 root-prim))) + (set! (-> v1-8 prim-core collide-as) (collide-spec)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-10 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self focus-status) (logior (focus-status pilot-riding pilot) (-> self focus-status))) + (set! (-> self coming-from-pw) #t) + (none) + ) + :exit (behavior () + (logclear! (-> self flags) (citizen-flag persistent)) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (none) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self vehicle)))) + (when (or (not a0-1) (logtest? (-> (the-as vehicle a0-1) flags) (rigid-body-object-flag dead))) + (if a0-1 + (remove-rider (the-as vehicle a0-1) self) + ) + (let ((v1-9 (-> self root-override2 root-prim))) + (set! (-> v1-9 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-9 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (set! (-> self vehicle) (the-as handle #f)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)))) + (set! (-> gp-0 y) 1.0) + (vector-normalize! gp-0 40960.0) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'attack) + (set! (-> a1-6 param 0) (the-as uint #f)) + (let ((v1-15 (new 'static 'attack-info :mask (attack-info-mask vector id knock)))) + (let* ((a0-11 *game-info*) + (a2-1 (+ (-> a0-11 attack-id) 1)) + ) + (set! (-> a0-11 attack-id) a2-1) + (set! (-> v1-15 id) a2-1) + ) + (set! (-> v1-15 vector quad) (-> gp-0 quad)) + (set! (-> v1-15 knock) (the-as uint 7)) + (set! (-> a1-6 param 1) (the-as uint v1-15)) + ) + (send-event-function self a1-6) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (countdown (gp-0 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 4.0 0) 0.25) + :frame-num (ja-aframe 0.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 0.25)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 8.0 0) 0.5) + :frame-num (ja-aframe 4.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (cond + ((zero? (rand-vu-int-count 2)) + (countdown (gp-3 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 12.0 0) 0.25) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.25)) + ) + ) + ) + (else + (countdown (gp-4 (+ (rand-vu-int-count 4) 1)) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 16.0 0) 0.4) + :frame-num (ja-aframe 12.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0) 0.4)) + ) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (ja-aframe 4.0 0) 0.5) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0) 0.5)) + ) + ) + #f + (none) + ) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; definition for method 199 of type city-lurker +;; WARN: Return type mismatch int vs none. +(defmethod set-behavior! city-lurker ((obj city-lurker) (arg0 traffic-object-spawn-params)) + (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((zero? v1-0) + (go (method-of-object obj idle)) + ) + ((= v1-0 2) + (go (method-of-object obj active)) + ) + ((= v1-0 3) + (go (method-of-object obj hostile)) + ) + ((= v1-0 6) + (logior! (-> obj flags) (citizen-flag persistent)) + (go (method-of-object obj idle)) + ) + ((= v1-0 7) + (logior! (-> obj flags) (citizen-flag persistent)) + (go (method-of-object obj wait-for-ride)) + ) + (else + (go-inactive obj) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 181 of type city-lurker +;; WARN: Return type mismatch int vs none. +(defmethod citizen-init! city-lurker ((obj city-lurker)) + "Initialize [[citizen]] defaults." + (let ((t9-0 (method-of-type civilian citizen-init!))) + (t9-0 obj) + ) + (let ((v1-1 (-> obj nav))) + (set! (-> v1-1 sphere-mask) (the-as uint #x800fe)) + ) + 0 + (none) + ) + +;; definition for method 114 of type city-lurker +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! city-lurker ((obj city-lurker)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (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! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 115 of type city-lurker +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! city-lurker ((obj city-lurker)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-city-lurker" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-enemy-behaviour-and-stats! obj *city-lurker-nav-enemy-info*) + (set! (-> obj info) *city-lurker-global-info*) + (let ((v1-6 (-> obj nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> obj draw lod-set lod 1 dist) 491520.0) + (set! (-> obj speed-run) 20480.0) + (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) + (set! (-> obj water-anim) 20) + (set! (-> obj jump-in-pipe?) #f) + (set! (-> obj task-done?) #f) + (set! (-> obj coming-from-pw) #f) + 0 + (none) + ) + +;; definition for method 74 of type city-lurker +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 134] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 139] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 110] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 118] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15] +(defmethod general-event-handler city-lurker ((obj city-lurker) (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" + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'nav-mesh-kill) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) + (change-to *default-nav-mesh* obj) + #t + ) + ((= v1-0 'traffic-activate) + (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (let ((s5-0 (the-as object (-> arg3 param 0)))) + (set! (-> obj root-override2 trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> obj root-override2 quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> obj root-override2 transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) + (when a0-10 + (change-to a0-10 obj) + (if (not (-> obj nav)) + (go-inactive obj) + ) + (let ((v1-17 (-> obj nav state))) + (set! (-> v1-17 current-poly) (the-as nav-poly #f)) + ) + 0 + (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) + (when a1-5 + (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root-override2 trans)) + (let ((a0-14 (-> obj nav state)) + (v1-24 (-> obj controller turn-exit-point)) + ) + (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-14 target-post quad) (-> v1-24 quad)) + ) + 0 + ) + ) + (citizen-nav-init! obj) + (citizen-init! obj) + (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (set! (-> obj gnd-height) (-> obj root-override2 gspot-pos y)) + ) + ) + (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + ) + ) + ((= v1-0 'traffic-off) + #f + ) + ((= v1-0 'traffic-off-force) + #f + ) + ((= v1-0 'traffic-on) + #f + ) + ((or (= v1-0 'hit) (= v1-0 'hit-flinch) (= v1-0 'hit-knocked)) + ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition of type city-meet-brutter-info +(deftype city-meet-brutter-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type city-meet-brutter-info +(defmethod inspect city-meet-brutter-info ((obj city-meet-brutter-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-meet-brutter-info) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) + (format #t "~1Tend-pos: #~%" (-> obj end-pos)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-meet-brutter-vehicle-info*, type (inline-array city-meet-brutter-info) +(define *city-meet-brutter-vehicle-info* + (new 'static 'inline-array city-meet-brutter-info 3 + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x 1161625.6 :y 73728.0 :z 3918233.5 :w 1.0) + :level 'ctypal + :end-pos (new 'static 'vector :x -451993.6 :y 32727.04 :z 2007572.5 :w 1.0) + ) + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x -743137.25 :y 73728.0 :z 1298800.6 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -494673.9 :y 32727.04 :z 2019041.2 :w 1.0) + ) + (new 'static 'city-meet-brutter-info + :pos (new 'static 'vector :x 401408.0 :y 73728.0 :z 3904471.0 :w 1.0) + :level 'ctypal + :end-pos (new 'static 'vector :x -509501.44 :y 32727.04 :z 1970462.8 :w 1.0) + ) + ) + ) + +;; definition for symbol *meet-brutter-position*, type (array vector) +(define *meet-brutter-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 207257.6 :y 65536.0 :z 2843975.8 :w 1.0) + (new 'static 'vector :x -1279795.2 :y 32768.0 :z 1825013.8 :w 1.0) + (new 'static 'vector :x 589414.4 :y 32768.0 :z 914636.8 :w 1.0) + (new 'static 'vector :x -457113.6 :y 32768.0 :z 1945559.0 :w 1.0) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'allow-continue #f 0 0) + (set-continue! *game-info* "ctyport-hiphog-no-hiphog" #f) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> gp-0 object-type) (traffic-type cara)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (not (-> gp-0 proc)) + (format #t "traffic object spawn failed~%") + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 3) + (set! (-> self count) 3) + (dotimes (v1-20 4) + (set! (-> self data-vector v1-20 quad) (-> *meet-brutter-position* v1-20 quad)) + ) + (let ((gp-1 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-1 vec)) + (forward-up-nopitch->quaternion + (-> gp-1 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-1 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-1 params 0 behavior) (the-as uint 1)) + (set! (-> gp-1 params 0 id) (the-as uint 0)) + (set! (-> gp-1 params 0 nav-mesh) #f) + (set! (-> gp-1 params 0 nav-branch) #f) + (set! (-> gp-1 params 0 proc) #f) + (set! (-> gp-1 params 0 handle) (the-as handle #f)) + (set! (-> gp-1 params 0 user-data) (the-as uint 0)) + (set! (-> gp-1 params 0 flags) (the-as uint 2)) + (set! (-> gp-1 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 0 velocity)) + (set! (-> gp-1 params 0 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 0 rotation) (-> gp-1 quat)) + (set! (-> gp-1 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-1 params 1 behavior) (the-as uint 0)) + (set! (-> gp-1 params 1 id) (the-as uint 0)) + (set! (-> gp-1 params 1 nav-mesh) #f) + (set! (-> gp-1 params 1 nav-branch) #f) + (set! (-> gp-1 params 1 proc) #f) + (set! (-> gp-1 params 1 handle) (the-as handle #f)) + (set! (-> gp-1 params 1 user-data) (the-as uint 0)) + (set! (-> gp-1 params 1 flags) (the-as uint 1)) + (set! (-> gp-1 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-1 params 1 velocity)) + (set! (-> gp-1 params 1 position quad) (-> gp-1 vec quad)) + (quaternion-copy! (-> gp-1 params 1 rotation) (-> gp-1 quat)) + (countdown (s5-1 (-> self max-count)) + (let ((s2-0 (-> *city-meet-brutter-vehicle-info* s5-1))) + (set! (-> gp-1 params 0 id) (the-as uint (+ s5-1 120))) + (set! (-> gp-1 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-1 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-1 params))) + ) + ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-1 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-1 params 1))))) + (when s3-0 + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (the-as uint 124)) + (set! (-> s3-0 index) (the-as uint s5-1)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-1) (process->handle s3-0)) + (set! (-> self data-int32 s5-1) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-1 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) + ) + ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) + ) + ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) + ) + ) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-1 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self data-int32 16) 0) + (set! (-> self data-int32 17) 0) + (set! (-> self data-int32 17) (rand-vu-int-count 4)) + (set! (-> self data-int32 18) (rand-vu-int-count 4)) + (change-parent self *traffic-manager*) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 6 + (the-as + (function object) + (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (let ((gp-0 arg0)) + (cond + ((= (-> self data-int32 (-> gp-0 index)) -1) + (+! (-> self data-int32 (-> gp-0 index)) 1) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (let ((v1-14 (-> self data-int32 16))) + (cond + ((zero? v1-14) + (talker-spawn-func (-> *talker-speech* 379) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 1) + (talker-spawn-func (-> *talker-speech* 381) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-14 2) + (talker-spawn-func (-> *talker-speech* 383) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (rand-vu-int-range (seconds 10) (seconds 20)))) + (+! (-> self data-int32 16) 1) + ) + ((= (-> self data-int32 (-> gp-0 index)) 1) + ) + ) + (change-parent gp-0 self) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (v1-163 float) (v1-205 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((v1-2 0) + (gp-0 0) + ) + (dotimes (a0-1 (-> self max-count)) + (let ((a1-3 (handle->process (-> self slave a0-1)))) + (when (-> (the-as city-lurker a1-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a0-1) 3) + ) + (if (and (logtest? (focus-status pilot) (-> (the-as city-lurker a1-3) focus-status)) + (!= (-> self data-int32 a0-1) -1) + ) + (+! v1-2 1) + ) + ) + ) + (cond + ((zero? v1-2) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-15 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-15) task-done?)) + (set! (-> self minimap s5-0) + (add-icon! *minimap* a1-15 (the-as uint 15) (the-as int #f) (the-as vector #t) 0) + ) + ) + ) + ) + ) + (when (-> self minimap 3) + (logior! (-> self minimap 3 flags) (minimap-flag fade-out)) + (set! (-> self minimap 3) #f) + ) + ) + (else + (dotimes (v1-30 (-> self max-count)) + (when (-> self minimap v1-30) + (when (-> self minimap v1-30) + (logior! (-> self minimap v1-30 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-30) #f) + ) + ) + ) + (if (not (-> self minimap 3)) + (set! (-> self minimap 3) (add-icon! *minimap* self (the-as uint 19) (the-as int #f) (the-as vector #f) 0)) + ) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-1 (zero? (logand (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-1) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) + ) + (when (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (the-as uint 2)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-1) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-1) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-1) (-> (the-as paddywagon s5-1) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-1) s3-0 (the-as city-lurker s4-1)) + (logior! (-> (the-as city-lurker s4-1) focus-status) (focus-status pilot-riding)) + ) + ) + ) + ) + ) + ) + (else + (if (not (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive))) + (send-event (the-as paddywagon s5-1) 'traffic-off-force) + ) + ) + ) + ) + ) + ) + (let ((gp-2 #f)) + (dotimes (v1-100 (-> self max-count)) + (if (= (-> self data-int32 v1-100) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-2 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-2)))) + (cond + ((= (-> self data-int32 s5-2) -1) + (when s4-2 + (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-2)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (the-as uint 0)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) + ) + ) + ) + ) + ((zero? (-> self data-int32 s5-2)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) + ) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-73 *target*)) + (when (and a0-73 (logtest? (focus-status pilot) (-> a0-73 focus-status))) + (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) + (when s3-3 + (cond + ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (handle->process (-> (the-as city-lurker s4-2) vehicle)) + ) + (+! (-> self data-int32 s5-2) 1) + ) + (else + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 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-163 vf1) + (let ((f0-2 v1-163) + (f1-0 32768.0) + ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-2) 1) + (when (the-as city-lurker s4-2) + (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-4 (-> self data-vector 3)) + (s2-1 (handle->process (-> *target* pilot vehicle))) + ) + (cond + ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (when (and s2-1 + (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) + (f1-6 114688.0) + ) + (< f0-4 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-1) root-override-2 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-205 vf1) + (let ((f0-5 v1-205) + (f1-9 421888.0) + ) + (< f0-5 (* f1-9 f1-9)) + ) + ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-4) + (let ((v1-214 (-> self data-int32 17))) + (cond + ((zero? v1-214) + (talker-spawn-func (-> *talker-speech* 380) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 1) + (talker-spawn-func (-> *talker-speech* 382) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-214 2) + (talker-spawn-func (-> *talker-speech* 384) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (+! (-> self data-int32 17) 1) + ) + ) + (else + (set! (-> self data-int32 s5-2) 0) + 0 + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-2) 2) + (let* ((s3-8 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-116 (if (type? s3-8 entity-nav-mesh) + s3-8 + ) + ) + ) + (if a0-116 + (change-to (-> a0-116 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 124 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 124 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) + (none) + ) + ) + ) + +;; definition of type city-save-lurkers-info +(deftype city-save-lurkers-info (structure) + ((pos vector :inline :offset-assert 0) + (level symbol :offset-assert 16) + (nav-mesh-id uint32 :offset-assert 20) + (end-pos vector :inline :offset-assert 32) + (pipe-name string :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type city-save-lurkers-info +(defmethod inspect city-save-lurkers-info ((obj city-save-lurkers-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-save-lurkers-info) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) + (format #t "~1Tend-pos: #~%" (-> obj end-pos)) + (format #t "~1Tpipe-name: ~A~%" (-> obj pipe-name)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-save-lurkers-pipe-info*, type (array city-save-lurkers-info) +(define *city-save-lurkers-pipe-info* + (new 'static 'boxed-array :type city-save-lurkers-info + (new 'static 'city-save-lurkers-info + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + ) + ) + +;; definition for symbol *city-save-lurkers-vehicle-info*, type (inline-array city-save-lurkers-info) +(define *city-save-lurkers-vehicle-info* + (new 'static 'inline-array city-save-lurkers-info 6 + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -821739.5 :y 71843.84 :z 1250508.8 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -884162.56 :y 71720.96 :z 281763.84 :w 1.0) + :level 'ctyfarma + :end-pos (new 'static 'vector :x -177111.05 :y 32727.04 :z 406487.03 :w 1.0) + :pipe-name "lurker-pipe-lid-6" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -189071.36 :y 72540.16 :z 4100874.2 :w 1.0) + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -806133.75 :y 71720.96 :z 4597432.5 :w 1.0) + :level 'ctyfarmb + :end-pos (new 'static 'vector :x -1521090.5 :y 37928.96 :z 3768975.2 :w 1.0) + :pipe-name "lurker-pipe-lid-4" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -152289.28 :y 71884.8 :z -637419.5 :w 1.0) + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + (new 'static 'city-save-lurkers-info + :pos (new 'static 'vector :x -957153.25 :y 70533.12 :z -1215078.4 :w 1.0) + :level 'ctygena + :end-pos (new 'static 'vector :x -739006.44 :y 32727.04 :z -1542383.2 :w 1.0) + :pipe-name "lurker-pipe-lid-2" + ) + ) + ) + +;; definition for symbol *save-lurkers-position*, type (array vector) +(define *save-lurkers-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 207257.6 :y 65536.0 :z 2843975.8 :w 1.0) + (new 'static 'vector :x -1279795.2 :y 32768.0 :z 1825013.8 :w 1.0) + (new 'static 'vector :x 589414.4 :y 32768.0 :z 914636.8 :w 1.0) + (new 'static 'vector :x -457113.6 :y 32768.0 :z 1945559.0 :w 1.0) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x 4698112.0 :y 40960.0 :z 81920.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (dotimes (v1-3 8) + (set! (-> self minimap v1-3) #f) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self max-count) 6) + (set! (-> self count) 6) + (dotimes (v1-8 4) + (set! (-> self data-vector v1-8 quad) (-> *save-lurkers-position* v1-8 quad)) + ) + (let ((gp-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params-1))) + (vector-reset! (-> gp-0 vec)) + (forward-up-nopitch->quaternion + (-> gp-0 quat) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (set! (-> gp-0 params 0 object-type) (traffic-type tt17)) + (set! (-> gp-0 params 0 behavior) (the-as uint 1)) + (set! (-> gp-0 params 0 id) (the-as uint 0)) + (set! (-> gp-0 params 0 nav-mesh) #f) + (set! (-> gp-0 params 0 nav-branch) #f) + (set! (-> gp-0 params 0 proc) #f) + (set! (-> gp-0 params 0 handle) (the-as handle #f)) + (set! (-> gp-0 params 0 user-data) (the-as uint 0)) + (set! (-> gp-0 params 0 flags) (the-as uint 2)) + (set! (-> gp-0 params 0 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 0 velocity)) + (set! (-> gp-0 params 0 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 0 rotation) (-> gp-0 quat)) + (set! (-> gp-0 params 1 object-type) (traffic-type tt5)) + (set! (-> gp-0 params 1 behavior) (the-as uint 8)) + (set! (-> gp-0 params 1 id) (the-as uint 0)) + (set! (-> gp-0 params 1 nav-mesh) #f) + (set! (-> gp-0 params 1 nav-branch) #f) + (set! (-> gp-0 params 1 proc) #f) + (set! (-> gp-0 params 1 handle) (the-as handle #f)) + (set! (-> gp-0 params 1 user-data) (the-as uint 0)) + (set! (-> gp-0 params 1 flags) (the-as uint 1)) + (set! (-> gp-0 params 1 guard-type) (the-as uint 7)) + (vector-reset! (-> gp-0 params 1 velocity)) + (set! (-> gp-0 params 1 position quad) (-> gp-0 vec quad)) + (quaternion-copy! (-> gp-0 params 1 rotation) (-> gp-0 quat)) + (countdown (s5-0 (-> self max-count)) + (let ((s2-0 (-> *city-save-lurkers-vehicle-info* s5-0))) + (set! (-> gp-0 params 0 id) (the-as uint (+ s5-0 120))) + (set! (-> gp-0 params 0 position quad) (-> s2-0 pos quad)) + (set! (-> gp-0 params 1 position quad) (-> s2-0 pos quad)) + (let ((s4-0 (the-as + paddywagon + (vehicle-spawn *traffic-manager* paddywagon (the-as traffic-object-spawn-params (-> gp-0 params))) + ) + ) + ) + (when s4-0 + (set! (-> s4-0 current-level) (-> s2-0 level)) + (set! (-> self slave (+ s5-0 (-> self max-count))) (process->handle s4-0)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 0 object-type) s4-0) + (let ((s3-0 (the-as city-lurker (citizen-spawn self city-lurker (-> gp-0 params 1))))) + (when s3-0 + (set! (-> s3-0 jump-in-pipe?) #t) + (set! (-> s3-0 pipe-name) (-> s2-0 pipe-name)) + (set! (-> s3-0 end-pos quad) (-> s2-0 end-pos quad)) + (set! (-> s3-0 task-node) (the-as uint 207)) + (set! (-> s3-0 index) (the-as uint s5-0)) + (set! (-> s3-0 nav-mesh-aid) (the-as uint 0)) + (set! (-> self slave s5-0) (process->handle s3-0)) + (set! (-> self data-int32 s5-0) -1) + (change-parent s3-0 s4-0) + (logior! (-> s3-0 flags) (citizen-flag persistent)) + (send-event *traffic-manager* 'add-object (-> gp-0 params 1 object-type) s3-0) + (set! (-> s3-0 controller traffic) *traffic-engine*) + (set! (-> s3-0 vehicle) (process->handle s4-0)) + (let ((s2-1 (get-best-seat-for-vehicle s4-0 (-> s4-0 root-override-2 trans) 4 0))) + (when (!= s2-1 -1) + (format #t "adding lurker to seat ~d~%" s2-1) + (put-rider-in-seat s4-0 s2-1 s3-0) + (logior! (-> s3-0 focus-status) (focus-status pilot-riding)) + ) + ) + ) + (if (not s3-0) + (format #t "brutter-task: unable to spawn rider~%") + ) + ) + ) + (if (not s4-0) + (format 0 "failed to spawn paddywagon~%") + ) + ) + ) + ) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 0 object-type) 0) + (send-event *traffic-manager* 'set-object-target-count (-> gp-0 params 1 object-type) 0) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (set! (-> self arrow) (the-as handle #f)) + (change-parent self *traffic-manager*) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 city-lurker) (arg1 object) (arg2 symbol)) + (case arg2 + (('task-done) + (let ((v1-1 arg0)) + (set! (-> self data-int32 (-> v1-1 index)) 2) + ) + ) + (('on-ground) + (cond + ((= (-> self data-int32 (-> arg0 index)) -1) + (+! (-> self data-int32 (-> arg0 index)) 1) + ) + ((= (-> self data-int32 (-> arg0 index)) 1) + ) + ) + (change-parent arg0 self) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 2 + (lambda :behavior task-manager + () + (local-vars (v1-178 float) (v1-231 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (check-time self) + (let ((a0-1 0) + (gp-0 0) + ) + (let ((v1-2 0)) + (dotimes (a1-0 (-> self max-count)) + (let ((a2-3 (handle->process (-> self slave a1-0)))) + (when (-> (the-as city-lurker a2-3) task-done?) + (+! gp-0 1) + (set! (-> self data-int32 a1-0) 3) + ) + (when (and (logtest? (focus-status pilot) (-> (the-as city-lurker a2-3) focus-status)) + (!= (-> self data-int32 a1-0) -1) + ) + (set! v1-2 a1-0) + (+! a0-1 1) + ) + ) + ) + (cond + ((zero? a0-1) + (dotimes (s5-0 (-> self max-count)) + (when (and (handle->process (-> self slave s5-0)) (not (-> self minimap s5-0))) + (let ((a1-4 (-> self slave s5-0 process 0))) + (if (not (-> (the-as city-lurker a1-4) task-done?)) + (set! (-> self minimap s5-0) (add-icon! *minimap* a1-4 (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + ) + ) + ) + ) + (when (-> self arrow) + (when (handle->process (-> self arrow)) + (send-event (handle->process (-> self arrow)) 'die) + (set! (-> self arrow) (the-as handle #f)) + ) + ) + ) + (else + (dotimes (a0-18 (-> self max-count)) + (when (-> self minimap a0-18) + (logior! (-> self minimap a0-18 flags) (minimap-flag fade-out)) + (set! (-> self minimap a0-18) #f) + ) + ) + (when (not (-> self arrow)) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (let ((a0-23 (-> self slave v1-2 process 0))) + (set! (-> s5-1 pos quad) (-> (the-as city-lurker a0-23) end-pos quad)) + ) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags)) + (set! (-> s5-1 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-1 (the-as task-arrow self)))) + ) + ) + ) + ) + ) + (dotimes (v1-45 (-> self max-count)) + (when (and (-> (the-as city-lurker (-> self slave v1-45 process 0)) task-done?) (-> self minimap v1-45)) + (logior! (-> self minimap v1-45 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-45) #f) + ) + ) + (set! (-> self count) (- (-> self max-count) gp-0)) + (set! (-> *game-info* counter) (the float (-> self count))) + (if (= gp-0 (-> self max-count)) + (go-virtual complete) + ) + ) + (dotimes (gp-1 (-> self max-count)) + (let ((s5-2 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) + (when (and s5-2 (zero? (logand (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) + (cond + ((or (not (-> (the-as paddywagon s5-2) current-level)) + (= (level-status *level* (-> (the-as paddywagon s5-2) current-level)) 'active) + ) + (when (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive)) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (traffic-type tt17)) + (set! (-> s4-0 behavior) (the-as uint 2)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (-> self slave (+ gp-1 (-> self max-count)))) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (the-as uint 2)) + (set! (-> s4-0 guard-type) (the-as uint 7)) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> (the-as paddywagon s5-2) root-override-2 trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> (the-as paddywagon s5-2) root-override-2 quat)) + (activate-by-handle *traffic-engine* s4-0) + ) + (let ((s4-1 (handle->process (-> self slave gp-1)))) + (when s4-1 + (let ((s3-0 + (get-best-seat-for-vehicle (the-as paddywagon s5-2) (-> (the-as paddywagon s5-2) root-override-2 trans) 4 0) + ) + ) + (when (!= s3-0 -1) + (format #t "adding lurker to seat ~d~%" s3-0) + (put-rider-in-seat (the-as paddywagon s5-2) s3-0 (the-as process-focusable s4-1)) + (logior! (-> (the-as process-focusable s4-1) focus-status) (focus-status pilot-riding)) + ) + ) + ) + ) + ) + ) + (else + (if (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive))) + (send-event (the-as paddywagon s5-2) 'traffic-off-force) + ) + ) + ) + ) + ) + ) + (let ((gp-2 #f)) + (dotimes (v1-111 (-> self max-count)) + (if (= (-> self data-int32 v1-111) 1) + (set! gp-2 #t) + ) + ) + (dotimes (s5-3 (-> self max-count)) + (let ((s4-2 (handle->process (-> self slave s5-3)))) + (cond + ((= (-> self data-int32 s5-3) -1) + (when s4-2 + (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s3-1 object-type) (traffic-type tt5)) + (set! (-> s3-1 behavior) (the-as uint 6)) + (set! (-> s3-1 id) (the-as uint 0)) + (set! (-> s3-1 nav-mesh) #f) + (set! (-> s3-1 nav-branch) #f) + (set! (-> s3-1 proc) #f) + (set! (-> s3-1 handle) (-> self slave s5-3)) + (set! (-> s3-1 user-data) (the-as uint 0)) + (set! (-> s3-1 flags) (the-as uint 0)) + (set! (-> s3-1 guard-type) (the-as uint 7)) + (vector-reset! (-> s3-1 velocity)) + (set! (-> s3-1 position quad) (-> (the-as city-lurker s4-2) root-override2 trans quad)) + (quaternion-copy! (-> s3-1 rotation) (-> (the-as city-lurker s4-2) root-override2 quat)) + (activate-by-handle *traffic-engine* s3-1) + ) + ) + ) + ) + ((zero? (-> self data-int32 s5-3)) + (when (the-as city-lurker s4-2) + (let* ((s2-0 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (s3-2 (if (type? s2-0 entity-nav-mesh) + s2-0 + ) + ) + ) + (when (and s3-2 (!= (-> (the-as city-lurker s4-2) nav state mesh) (-> s3-2 nav-mesh))) + (when (nonzero? (-> (the-as city-lurker s4-2) nav state mesh)) + (remove-process-drawable (-> (the-as city-lurker s4-2) nav state mesh) (the-as city-lurker s4-2)) + (set! (-> (the-as city-lurker s4-2) nav) #f) + ) + (change-to (-> s3-2 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + (let ((a0-95 *target*)) + (when (and a0-95 (logtest? (focus-status pilot) (-> a0-95 focus-status))) + (let ((s3-3 (handle->process (-> a0-95 pilot vehicle)))) + (when s3-3 + (cond + ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (handle->process (-> (the-as city-lurker s4-2) vehicle)) + ) + (+! (-> self data-int32 s5-3) 1) + ) + (else + (let ((v1-174 + (get-best-seat-for-vehicle (the-as vehicle s3-3) (-> (the-as vehicle s3-3) root-override-2 trans) 4 0) + ) + ) + (when (!= v1-174 -1) + (.lvf vf1 (&-> (-> (the-as vehicle s3-3) root-override-2 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-178 vf1) + (let ((f0-2 v1-178) + (f1-0 32768.0) + ) + (when (and (< f0-2 (* f1-0 f1-0)) + (let ((f0-3 (vector-vector-distance-squared + (-> (the-as vehicle s3-3) root-override-2 trans) + (-> (the-as city-lurker s4-2) root-override2 trans) + ) + ) + (f1-3 65536.0) + ) + (< f0-3 (* f1-3 f1-3)) + ) + (not gp-2) + ) + (set! gp-2 #t) + (send-event (the-as city-lurker s4-2) 'board-vehicle (the-as vehicle s3-3)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-3) 1) + (when (the-as city-lurker s4-2) + (let ((f30-0 (the-as float #x7f800000))) + (dotimes (s3-4 (-> *city-save-lurkers-pipe-info* length)) + (let* ((s2-1 (-> *city-save-lurkers-pipe-info* s3-4)) + (f0-4 (vector-vector-xz-distance (-> s2-1 end-pos) (-> (the-as city-lurker s4-2) root-override2 trans))) + ) + (when (< f0-4 f30-0) + (set! f30-0 f0-4) + (set! (-> (the-as city-lurker s4-2) pipe-name) (-> s2-1 pipe-name)) + (set! (-> (the-as city-lurker s4-2) end-pos quad) (-> s2-1 end-pos quad)) + ) + ) + ) + ) + (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) + ) + (let ((s3-5 (-> (the-as city-lurker s4-2) end-pos)) + (s2-2 (handle->process (-> *target* pilot vehicle))) + ) + (cond + ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + (when (and s2-2 + (let ((f0-5 (vector-vector-distance-squared s3-5 (-> (the-as vehicle s2-2) root-override-2 trans))) + (f1-6 114688.0) + ) + (< f0-5 (* f1-6 f1-6)) + ) + (begin + (.lvf vf1 (&-> (-> (the-as vehicle s2-2) root-override-2 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-231 vf1) + (let ((f0-6 v1-231) + (f1-9 40960.0) + ) + (< f0-6 (* f1-9 f1-9)) + ) + ) + ) + (set! (-> (the-as city-lurker s4-2) task-done?) #t) + (send-event (the-as city-lurker s4-2) 'exit-vehicle s3-5) + ) + ) + (else + (set! (-> self data-int32 s5-3) 0) + 0 + ) + ) + ) + ) + ) + ((= (-> self data-int32 s5-3) 2) + (let* ((s3-6 (entity-nav-mesh-by-aid (the-as actor-id (-> (the-as city-lurker s4-2) nav-mesh-aid)))) + (a0-134 (if (type? s3-6 entity-nav-mesh) + s3-6 + ) + ) + ) + (if a0-134 + (change-to (-> a0-134 nav-mesh) (the-as city-lurker s4-2)) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) + (suspend) + (send-event *traffic-manager* 'set-target-level #x3f400000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 207 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 207 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (let ((v1-2 0)) + (dotimes (a0-0 6) + (let ((a1-3 (handle->process (-> self slave a0-0)))) + (if (and a1-3 (-> a1-3 next-state) (= (-> a1-3 next-state name) 'inactive)) + (+! v1-2 1) + ) + ) + ) + (if (= v1-2 6) + (goto cfg-20) + ) + ) + (suspend) + 0 + ) + #f + (label cfg-20) + (task-node-close! (game-task-node city-save-lurkers-save-lurkers)) + (none) + ) + ) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 2bf47a9a5b..815924a832 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -47,6 +47,7 @@ "DGO/LBOMBBOT.DGO", "DGO/LERLCHAL.DGO", "DGO/LKIDDOGE.DGO", + "DGO/LMEETBRT.DGO", "DGO/LPORTRUN.DGO", "DGO/LSACK.DGO", "DGO/MCN.DGO",